Recovering a lost root password

Dec 17, '00 11:09:25PM

Contributed by: robg

Although there's no real way to recover a lost root password, you can change the root password even if you do not know the current one. You must have physical access to the machine in order to accomplish this task. The following steps were originally noted on this MacNN forum, which contains a number of follow-up messages about security in general - well worth the reading time.

NOTE: The following information has been publicly disclosed on a number of Internet sites, and is not a new find. I'm simply repeating it here for the sake of completeness.

Read the detailed section of this article for step-by-step instructions on regaining access to your root account.

Originally posted by QuantumFusion on the MacNN forums, and repeated with slight readbility changes, here are the steps to regain access to root:

  1. Click Restart at the login 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 /
    /sbin/SystemStarter
    You will then see various services starting up.

  4. When the Localhost% prompt reappears, type:
    passwd root
    It will then ask you to type the new root password twice, so do so.

  5. After entering the new password, type:
    reboot
At the login window, enter username root wih 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.

Comments (17)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20001217230925152