這篇How to create a new user on Mac – The Geek Way的指令比較容易複製來用
Step 1. Open Terminal. You can do that by clicking on the Terminal icon from the Utilities menu. Just drag down the Finder toolbar to reveal all the utilities. Step 2. Type in the following line: sudo dcsl . -create\Users\Username Usershell /bin/bash Hit Enter to continue. Step 3. Type in the following line: sudo dscl . -create/Users/username RealName “Nicky Summer” Of course, you will need to change the “Nicky Summer” string with the user’s real name. When ready, smash that Enter button to continue. Step 4. Type in or paste the following line: “sudo dscl . -create/Users/username UniqueID 1001 Please note that the UniqueID’s attribute must be different for each user (i.e. Marc Smith and John LeGrand, two fictional users, cannot both have 1001 as the UniqueID). Step 5. Type in or paste the following line: sudo dscl . -create/Users/username PrimaryGroup ID 1000 Hit Enter to continue. Step 6. Type or paste this line: sudo dscl . – create/Users/username NFSHomeDirectory/Local/Users/username This command will allow you to whip up a home folder for the newly created user. Step 7. Type in or paste the following line: sudo dscl . -passwd\Users\username password Of course, you will need to replace the “password” string with anything your heart desires. When ready, press Enter to continue. (Optional) To grant the newly created user admin privileges, you will need to type in or paste the following line: sudo dscl . -append/Groups/admin GroupMembership username Press Enter to continue. Congrats! You now know how to create a new Mac user using the Terminal. Get your lines straight, write the lines in order, and everything will be hunky-dory.