In case your forgot or lost your os x password (and you have no other user with admin rights), you have to reset the default user’s pass. This can be done via the Mountain Lion Recovery HD partition. Follow these steps.
- Shutdown your mac.
- Boot it. Hold “Option” at boot and select the “Recovery HD” disk at the boot menu
- Wait for the recovery hd to load until “Mac OS X Utilities” menu appears.
- Click on the “Utilities” menu and select “Terminal”
- In Terminal, type the following:
resetpassword
- Confirm the password change and reboot as usual as usual and you are ready to go using your newly created pass.
Note that prior to os x 10.7 there was a “Reset Password” menu item in the Utilities menu, which was the easiest way to reset a lost password.
If the above method does not work you can boot to recovery mode, launch the Terminal from the Utilities folder and type:
rm /var/db/.AppleSetupDone
Note that this will not reset your password but it will let you run the default setup procedure (like when you get a new mac) and create a new admin account the next time you boot your machine (it will not delete your old acount). After rebooting, follow the procedure to create the new account and then navigate to system preferences>user & groups and reset the password for your old account. If settings in user & groups are faded out, click on the lock icon in the lower left corner and authenticate (using your new account credentials).