jump to navigation

Reset Mac Password the Easy Way July 5, 2009

Posted by bigmaconcampus in Mac Tech.
Tags: , , , , , , , ,

*** Please Note!!! ***

The instructions in the main post are for Mac OS X 10.5 and 10.6. If you are using Mac OS X 10.7 or higher, you can just reboot and hold down the “R” key while it reboots to enter recovery mode. Then open the terminal and type “resetpassword” to use the password reset utility. Much easier than everything you will read in the post below. Now returning to your ancient post, already in progress…

*** Original Post ***

We are swimming in the middle of summer workshops at our University. We do these a couple of times a week and the purpose is to help introduce the new, incoming students to University specific systems, setup wireless for the school and install software. We even offer Windows for the few that might want it. All this in less than 2 hours.

A good time is had by all…

One of the problems we run into regularly is the one in 50 students that either can’t remember their Mac password (even though we ask them to try and guess it about 10 times). Or better yet, the parental units, being helpful, did the original setup for the child they love instead of letting them gain some independence and do it themselves, thereby screwing them over in their first college experience. But I digress.

When we run into this situation, we need to reset their password quickly and painlessly. Not always having installation discs handy, we resort to doing it in Single-User mode.

To do this, reboot the computer holding down the command (Apple symbol on older Macs) and ‘S’ key at the same time. After about 10 seconds or so, you’ll see a very Unix-y OS loaded. You may want to hit return a couple of times to make sure it has finished loading.

WARNING: Doing the next part will cause you to lose any saved passwords in your Keychain. If you are locked out of the Mac anyway, you really have nothing to lose though.

At this point, you have booted the computer as root and need to run the following commands:

mount -uw /

launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist

ls /Users (to get the username to reset if you do not know it)

passwd username (username being the username you are resetting)

reset password (password being the new password)Sorry, realized the wording was confusing. Just type the new password and press return (nothing will show on screen while you are typing. You will need to enter it a second time to verify and ward off typos.

rm -rf /Users/username/Library/Keychains/login.keychain


After the computer reboots, you should be able to login using the new password now. Be aware, that the system will create a new login.keychain for you with no passwords in it. You can force this creation immediately by opening Safari.

p.s. This method only works on Leopard 10.5.x. or higher.