Insights Technical Hub How to boot into single-user mode on a Macintosh

How to boot into single-user mode on a Macintosh

Introduction:

If you need to reset the administrator password on a Macintosh, you can boot to single-user mode to change it.

Requirements:

Access to a Macintosh computer, and you will need the username you are trying to reset. There is a method to find this, however.

Procedure:

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/lrodney password

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/lrodney password

Replace lrodney with the user whose account you want to access and password 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 have still worked.

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 command after loading:

opendirectoryd.plist:
passwd root

Once finished, you should have access to most of their system, including their saved passwords for other apps.

Let's make your job easier

Sign up to get insightful content