Subscribe to MacYourself via RSSFollow MacYourself on Twitter

How to reset password for Mac OS X 10.7 Lion

How to reset password for Mac OS X 10.7 Lion

One of the most common questions Mac users ask is, “How do I reset my Mac’s password?” If you’re using Mac OS X 10.7 Lion or 10.8 Mountain Lion, there are a couple ways you can go about it – and they’re both pretty easy to do.

MacYourself previously published a popular article explaining how to reset the password on Macs running 10.4, 10.5 and 10.6. Unfortunately, those methods no longer work in 10.7 Lion or 10.8 Mountain Lion. That doesn’t mean you’re out of luck – there are new ways to reset a password in Lion.

As mentioned in our original article, it’s important to remember that anyone with physical access to your computer (whether it is a Mac, Windows or Linux) can eventually find a way in. There’s no such thing as complete security if someone who knows what they’re doing is sitting in front of your computer. If you’re truly concerned about the security of your files, you should look into using FileVault to encrypt them.

Reset password using Lion Recovery

If you bought a brand new Mac with Lion pre-installed, the hard drive includes with a recovery partition that gives you access to a bunch of different tools. Here’s how to take advantage of this utility to reset your Mac’s password:

  1. Shut down your Mac and turn it back on while holding down the Command and R keys at the same time until you see the Lion Recovery screen.
  2. From the menu bar at the top, select Utilities > Terminal.
  3. In the Terminal window type resetpassword and press Enter.
  4. Use the Reset Password utility to select your hard drive, choose your user account, and enter a new password.

Reset Lion password with Single User mode

Anyone running Mac OS X Lion can take advantage of this method:

  1. Shut down your Mac and turn it back on while holding down the Command and S keys at the same time until your see a black screen with white text. This is known as Single User mode.
  2. You can skip this step, but it’s recommended that you don’t because it will check the consistency of your hard drive. At the prompt, type fsck -fy and press Enter.
  3. Once the disk check is complete and the prompt returns, type mount -uw / and press Enter.
  4. Type launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist and press Enter.
  5. Type ls /Users and press Enter. All of the usernames on the computer will be listed, which is helpful if you don’t know or remember what these are.
  6. Type dscl . passwd /Users/username password while replacing username with one of the users displayed in the previous step and replacing password with the new password of your choice. Press Enter. You will likely get an error message about a file or directory not being found – it’s safe to ignore this.
  7. Type reboot and press Enter.
Tags: , ,

66 Comments Have Been Posted (Leave Your Response)

Whewwwww! Thanks. I was dead in the water. This solution solved my problem.

Might be a hacker now
April 22nd, 2014, 8:17 AM

Thanks so much, always feel pretty sketchy when i try do these things. Worked a dream have the confidence to hack in to the cia now (only joking). Cheers

It didn’t work for me at all

I used this little dodge with great success when I upgraded a lap top to Mavericks, now the PITA owner has forgotten the password I changed it to, and so have I LOL.

Does anyone know if this works with OS x 10.9 mavericks ?

socket not connected
May 13th, 2014, 3:39 AM

HELP!

the command line:
/bin/launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist

comes up with:
socket is not connected

Has anyone got any clues?

I’m getting socket not connected too. Please what is the next step. Thanks

I just used it successfully (as is) with Mavericks 10.9.4.

You definitely don’t want that “/bin” in front of “launchctl”, which is not in the /bin directory.

On my machine the single user startup screen shows a prefix “/sbin” on the “fsck” and “mount” commands, but it should be optional.

P.S. The voice of experience: Don’t miss the slash at the end of the mount command: “mount -uw /”

You just saved my life!!!!!!

my macbook does not want to open the password i put.
i have used this password since and havnt changed in anyway please help.tried restarting with cmd+r the pop screen is not helping .

10.7.5 OS X worked Great

i need a quick access to reset my password and name.

HELP! Command +R and command +s both failed to work for me. I somehow ended up with an iMac in my garage, and have no clue where it came from. I’d like to get into it and use it for my grandson. I know it’s OSX but no idea which version.Can anyone tell me how to get in? Or who I can take it to?

Thank you this worked great on 10.7.5 Helped a ton thank you!

Thank you.. so much!!!!

The apple desktop does not open when I put in th epassword. I went through the steps and got to the end but when I enter reboot and enter…nothing happens.

Can anyone offer some advice?

I got as far as entering a new password, but it is telling me it is not allowed. Anyone have an idea. Just can’t remember the password I used. It has been a few years since I have tried to boot up.