Digital Locksmith: Change the root password on OSX; several methods

a7be6985-be9d-43fc-9a5b-b4eb74150824

I’m not a big fan of Macs. If I wanted to run BSD I would. If I want the easy GUI I’ll run Windows. If I want the elitist snob crowd, I’ll run Gentoo Linux (kidding, step away from the door and please put the axe down now).

I am also not a big fan of Apple’s marketing (hey Steve, here’s a hint; those adds were funny for like the first 10, now they make you look like a snobby braggart, and somewhat of a jerk), especially now that Apple is saying that no reasonable person would believe their marketing (wait, what?).

f8cbd226-6e69-4952-8d59-a2bfefe62a55

That being said, I do know a thing or two about them, for instance, how to reset the root password without having the root password.

NOTE: Do not do this if you have FileVault Enabled!!! If you reset the root password and have FileVault enabled this will not reset the FileVault master password, and any files protected with FileVault will not be accessible. There is a discussion in the Apple Forums that discusses a way to possibly reset the FileVault password, but I have not tried this, so I cannot verify that this method works. The discussion is available here, if you try this I strongly urge you to backup all files (including system files) before you try it.

Method 1:

  1. Restart your computer,
  2. Dold down Command-S during boot, and type the following at the terminal prompt:
  3. /sbin/fsck -y {ENTER}
  4. /sbin/mount -uaw {ENTER}
  5. mv /var/db/.applesetupdone /var/db/.applesetupdone.orig {ENTER}
  6. reboot {ENTER}

Once you’ve done that the computer reboots and ask you to set up an admin password. From there you just change all other account passwords in the account preferences.

NOTE: Step 5 in this process renames the /var/db/.applesetupdone file so that if you encounter issues you can change it back and be back to square one.

Method 2:

  1. Click Restart at the log in window.
  2. While the computer is restarting, hold down “Command-S” until you see text scrolling through the window. This boots the computer into single user mode.
  3. At the Localhost% prompt type:
    /sbin/mount -uw / {ENTER}
    /sbin/SystemStarter {ENTER}

    You will then see various services starting up.

  4. When the Localhost% prompt reappears, type:
    passwd root {ENTER}

    It will then ask you to type the new root password twice, so do so.

  5. After entering the new password, type:
    reboot {ENTER}

At the log in window, enter user name root with the new password. Once you are connected, you can use the Multiple Users application (/Applications/Utilities) to change your normal user’s password, or create a new user account.

If you cannot get that to work, and you just want to get the files off, you can use Target Disk Mode to do so, assuming that an Open Firmware Password has not been set, and that the files you want are not protected by FileVault.

But what if that fails? Well you have one final option if the computer is not protected by an Open Firmware Password: reinstall the System files by booting to an Install disk and selecting “Archive and Install”. This will only restore the System files, and all the users and their files should be accessible. Again this should be the method of last resort.

end

%d bloggers like this: