OS X: Password Reset Using Recovery System
Instead of a set of utilities and recovery CDs, OS X Lion or OS X Mountain Lion stores these applications on a disk partition. To access this recovery system, restart your Mac, after hearing the Apple startup gong, hold the Command and R keys (Command-R) until the Apple icon appears. After the Recovery System is finished starting up, you should see a desktop with the OS X Menu bar and a “Mac OS X Utilities” application window.
Launch the Terminal Utility by selecting Terminal from the Utility menu.
Enter the following command in the Terminal Utility window command line:
In the Reset Password window, select the disk volume containing the user account requiring the password reset. Select the user account from the pull down menu. Enter the new password in the appropriate text boxes. You can optionally provide a password hint. Click Save.
Select Restart from the Apple Menu.
Note: When logging into the user account for the first time there will be a warning indicating that the system was not able to unlock the account’s login keychain. Since that requires the old password, select “Create New Keychain.”