I need to add a new user via the command line in single-user mode. I reinstalled OS X earlier, and for some reason, it didn't create my user account properly. Now I can't log in. So I'm wondering how exactly I can go about creating a new user account without reinstalling everything.
I tried this, but it didn't work: http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/
Thanks in advance.
If you type cd / , you'll go to the root level of your startup disk. If you type cd .. (that's two periods), you'll go to the directory above the one you're currently in. So if you're in your home folder, and type cd .. , you'll go to your Mac's /Users folder.
To see your existing user accounts, go to System Preferences > Users & Groups. This preference pane shows a list of existing user accounts, lets you create new accounts, and it also lets you set a number of login options. Start by looking at your own user account; it's at the top of the list under Current User.
rm /var/db/.AppleSetupDone
...and then reboot normally. With that file gone, OS X launches its first-run Setup Assistant and (among other things) lets you create a new account.
BTW, the reason niutil
isn't there has nothing to do with whether it's a server or not -- it's because Apple got rid of NetInfo (its old database for storing local users) in 10.5, and replaced it with a new XML-based system. If you want to do niutil
-ish things in 10.5, you can either use dscl
(this is actually a bit complicated in single-user mode because directory services aren't running) or create/edit the XML files by hand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With