Running Snow Leopard. Completely inexplicably, I seem to have enabled the OSX root user by accident. I honestly have no idea how it happened, but if memory serves I was looking at the login pane (with my two user accounts) when I must have hit something, and suddenly the two accounts were replaced by one that just said "Other..."

Clicking the "Other..." account allows me to type a username and password, but neither of the normal two accounts would work. Since I never set a root password, it wouldn't let me in that way either.

So I booted into Single User mode and ran these commands:

/sbin/mount -uw /
fsck -fy
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
dscl . -passwd /Users/root newpassword

and that let me login as root. Then, I went to System Preferences, Accounts, Login Options, clicked Join, Open Directory Utility, and lastly in the Edit menu I clicked "Disable Root User"

Great, I thought, back to normal. Except rebooting, I still only have the Other... account visible, and the root password I set beforehand doesn't work anymore! I have to reboot into Single User Mode and go through the whole process again just to get back into the system (as root)

How on Earth did I accidentally enable this? I didn't even know about the Directory Utility before now. And most importantly, why the heck would it be re-enabling the root user on boot? Thanks in advance to any help!


The problem turned out to be that the /Users folder, or some related configuration became corrupt. My user home folders were still there but the Accounts pane of System Preferences didn't list them.

Running ls -lah on /Users showed that my two normal accounts had "501" and "502" as the user and "staff" as the group, rather than the expected shortnames as the users.

This was resolved by simply re-creating the user accounts and opting to use the existing home folder. Wish I'd thought to do that. All is well now though.

  • Good find. Now if only you could recall how you got root in the first place :-). – user3463 Jan 9 '11 at 2:39

Revert to an old Time Machine backup, or failing that, an Archive and Install and repair your installation. It sounds like you've broken it irreparably.

  • The problem at the moment is that I'm traveling and only have the laptop itself. I was hoping to avoid a few days of waiting and then a repair installation. But, if that's my only option... ah well. – geodave Jan 6 '11 at 20:16
  • I think you're pretty poked if you've enabled root. There's a place I wouldn't want to go: unsupported Mac OS X territory. At least you have a workaround, which although not ideal, allows you to still use the laptop. – user3463 Jan 6 '11 at 20:25
  • If I could find some startup script or something, a configuration file that might possibly be overriding my "disable root user" command, then I'd be somewhere. Sadly I am inexperienced with the *nix backend that OSX runs on. – geodave Jan 6 '11 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.