1. Restart the Mac holding down the Command+S keys, this will take you into Single User Mode and it’s Terminal interface
2. You’ll need to check the filesystem first:
3. Next, you must mount the root drive as writeable so that changes will save:
mount -uw /
4. Now, type the following command exactly, followed by the enter key:
5. After removing the applesetupdone file, you need to reboot, type ‘reboot’ and hit enter
6. Upon reboot, you will be presented with the traditional “Welcome Wizard” startup screen just like when you first get a Mac
7. Follow the welcome wizard and create a new user account – making the account name different from the account whose password you want to recover
8. Continue on and boot into Mac OS X with this newly created user account, this new user account is an Administrator and has administrative access.
9. Go to System Preferences >> Accounts >> Reset your old account password.