1. You do not know any password and you have no OS CD
You need to know your username (the username you wish to reset the password)
Hold Apple+S when booting to enter single user mode
#sh /etc/rc#passwd yourusername#reboot
All keychain passwords will be lost
2. You do not know any password but you have OS CD
Boot the system from the Mac OS X installation CD and select the Reset password option from the installer screen and follow the directions.
3. You have admin password but you have not root password
You have access to for mac using a username (admin) on the system. If you have not then read above. Open a terminal or X11 window and type (only what is after $):
yourusername$ sudo passwd root
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!
As long as 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.



(20 votes, average: 4.75 out of 5, rated)