The two most popular methods of resetting the admin password on the Mac (without the CD) are:
- Recovery Mode
- Single User Mode
Recovery Mode
In Lion and Mountain Lion you can use Recovery Mode to reset the password.
1. Restart the computer and hold down Command + r until the menu screen appears.
2. Click Terminal from the Utilities Menu and enter this:
resetpassword
Single User Mode
The other option is to delete the Apple Setup file to trick the Mac into thinking it just came off the truck from the factory.
After deleting the Setup File and rebooting, you’ll see a “Welcome to Mac OS X” setup screen which will walk you through the process of creating a new admin account. To make it happen, we have to boot into something known as Single User Mode. This is a limited environment with no graphical user interface but is very helpful when you need to perform advanced troubleshooting.
1. Reboot the Mac and hold down Command + s to enter Single User mode. Keep holding down Command +s until you see a black screen with white text.
2. The command prompt is that right rectangle near the bottom of the screen. At the command prompt enter this:
mount -uw /
This mounts the root file system (the forward slash /) and tells the computer to change the status of any already mounted file systems (that’s the -u part of the command) and make sure it’s read-write (the w in the command).
3. Press enter to move to the next line and type this:
rm /var/db/.AppleSetupDone
The rm part removes directories. In this case, it’s removing a directory that lives in a “/var/db/ called.AppleSetupDone”. Deleting this folder is the trick that forces the Mac to think it has a new lease on life.
4. Press enter to move to the next line and finish up with this command:
shutdown -h now
The dash h halts the Mac at a specified time, in this case we’re saying, “Shutdown Now”. After executing this command, press the power button to turn the Mac back on and you’ll see the setup introduction screens.