Reset the Password in Single User Mode
SEXPAND
If you don't have an installer CD handy, you just need to do a
bit of fancy command-line footwork to achieve the same end as the CD method.
Boot up the computer, holding Command+S as you hear the startup chime. The Mac
will boot into single user mode, giving you a command prompt after loading
everything up. If the Mac is running Snow Leopard or below, type the following
commands, hitting Enter after each one and waiting for the prompt to come up
again before running the next one:
/sbin/fsck -fy
/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
dscl . -passwd /Users/whitsongordon lifehacker
/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
dscl . -passwd /Users/whitsongordon lifehacker
If the Mac is running Lion or above, you'll instead want to use
the following commands:
/sbin/fsck -fy
/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
dscl . -passwd /Users/whitsongordon lifehacker
/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
dscl . -passwd /Users/whitsongordon lifehacker
Replace whitsongordon with the user whose account you want to access andlifehacker with the new password you want to assign to that user. If you
get an error message about com.apple.DirectoryServicesLocal.plist on a Lion or Mountain Lion machine, just ignore it—the password
reset should still work.
If you don't know the user's username, it should be pretty easy
to run ls /Users at any time during single user mode to list all the home folders
on the Mac, which usually correspond to the usernames available on the Mac.
Note that the user's password is different than the root password. If you want
access to the more secured parts of their machine—like their password
keychain—you can change their root password by running this commandafter
loadingopendirectoryd.plist:
passwd root
Once finished, you should have access to most of their system,
including their saved passwords for other apps.