Sunday, March 14, 2010

Mac OS X recover lost root password

If you have the password to an account that is an administrator on the system, then it is easy to recover the password using the sudo command. Open a terminal window and type:

sudo passwd root
and you will be prompted for your password (the user account that you do remember). Then you will be prompted for the new root password twice. That’s it!

The sudo command is a wonderful way to control who can do what on a system. In this case, since the user account is considered an administrator, the sudo command allows you (after confirming that you are who you say you are with the user password) to run a command as if you were root. The command we are running is passwd root which is the command to change the password for the root user.

If you do not have an administrator password, either, you can still reset the root password. Boot the system from the Mac OS X installation CD and select the Reset password option from the installer screen and follow the directions.


No comments:

Post a Comment