Subscribe to MacYourself via RSSSubscribe to MacYourself via EmailFollow MacYourself on Twitter
Apple Products and Accessories from Amazon.com

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: , ,

58 Comments Have Been Posted (Leave Your Response)

man… you’ve saved my my life… thanks for this!

i cant do anything with the first option it appears a big lock and ask me for a password. and the second the solomode doesnt enter..

This might have helped, but I’m not sure because when restarting, it only gets as far as the apple picture and the turning thing under it. This might be due to a couple of commands I have tried before, but I don’t know for sure.

this doesnt work for me, ive tried both. ive switch it off completely & restarted then trying both cmd&R & cmd&S non work, just takes longer to come on before bringing up the ‘password’ box again asking me for it.

please help. i have all my uni work on my laptop & i cant find my discs so i desperately need this to work for me!

Thank you soooo much!!!! Couldn’t believe how easy this was

Thanks, worked a treat

Does this work on older OS X systems (Leopard etc.)
Tried it on my Lion and worked a treat, but I need to change an old 10.5 password and it would be easier to use this as I can remember it.

it do not work. After launchctl load, it say …socket is not connected….i need help….anybody………….

Thanks, it worked great. It took me to the initial login and first st up screen and the I just followed the registration steps and now everything is working fine.

Worked like a charm on our mini Mac (Lion)! Thank you!

Woooooo / Thanks a lot!!

not working for me i hold down both command + r
then i get a lock and I don’t know what the password is i use the one that i use to log into my computer but that don’t do nothing I don’t recall setting up a certain password to get into the hd recovery anyone can help that would be great THANK’S

Omg thank you do much for this!!! Totally saved my butt. My main problem was I had forgotten my username (normally its already entered in) then I fiddled wih some settings and I forgot my username. When I went in via the first option I saw my username and then all was well. Phew! First time Mac user so I’m fresh at this. Already bookmarked the page for future reference. Thanks again!

I bought a MacBook pro from a friend and don’t remember the log in password and is their any way to bypass that?

Prashant Mudgil
June 14th, 2012, 7:32 PM

I can’t thank you enough coz none of the steps on other websites worked for me…have 10.7.3 and your steps to “Reset Lion password with Single User mode” fixed the issue…Thank you again :)

good man….i bought a laptop from ebay…the first method worked for me, should of tried that first wha?
cheers…kevin…. london.

Thank you this was a life saver!

Jaime and Rick:
You are seeing a firmware password screen. That is not for user login. That was added for theft security. Ask the owner of the computer about that screen…. if you know the owner.

I am having a problem after step 4. After typing “launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist”. It tells me “socket is not connected”. What is this?!

I have the same problem as Thomas. “Socket is not connected”. What socket? Why?

Thank you so much you have actually saved my life, i used the first technique, so easy!

WIll this delete your files? :(

thanks so much saved me from a lot of trouble so much easy than apple’s way

thank you a lot.

Thank You ,So much !!!!!
It was very helpful! Apple support was asking 50$ for the help with password.

Wow, very easy to do… thanks!

Glad to have finally found this post. Instructions were easy to follow and worked perfectly the first time! Thank you so much!

I’m having the same problem as Thomas and Marius. I get “socket is not connected” after having typed step 4. Can anyone help with that?

Jim Thomas and Marius . make sure you mounted the disk in read write mode as described by step 3

To make the Single user method work in Mountain Lion, you should add the full path to the launchctl command.

/bin/launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist

Thanks!

How do I secure my mac such that folks can’t easily use instructions like these to reset the password? Encryption maybe?

Catch its breath.
He had changed the password and type of memory something else
Thank You!

I cannot press the command + s. There will be like ermm sounds? Help me thanks

Oh my gosh! This is the only one that works on my mac! I tried several suggestions, none of them work except for this one! thank you so much!

I am getting socket is not connect after step 4, anything I can do to fix this?

Will this enable access to a drive protected by Filevault?

Thank you thank you

Wow!!! Thank you SO much!!!! Very easy to do when someone tells you how to!!! Relief!!!!!

Thank you!!!
Excellent information for OS X 10.8

When i type Is /Users .its say faild…please help me….

I forgot my login password for iMac laptop lion 10.7.

Went into “reset lion password with single user mode” and followed instructions 1 & 2. I closed down computer , held down cmd and s keys and started up computer, the black screen and white writing appeared, but can’t find my cursor. And I can’t shut down laptop or get out of the screen.

Can anyone help, Thanks. Alan.

Thank-you so much! After I reinstalled OS and installed time machine back up, my login password wouldn’t work. So frustrating! The “Reset Password Using Lion Recovery” worked!

Hi , command+s or command+r keys are not working for mac mini mid 2010 . it’s a core 2 duo configuration . can anybody please help me to reset password

It was not working for me either. I don’t know if it because I have a Bluetooth keyboard or what. But I got it to work. An old trick that would work for me sometimes when I used to build pc’s and holding would not work. I semi rapidly pressed both buttons at once until I got the screen that is required. It worked for both command S and command R.

I can’t believe it. And can’t thank you enough. 2nd option worked for me. Now I can finally update softwares on my laptop. Thank u so much!!

So. When I command+S it briefly goes to the black screen for about 2 seconds then straight to the login screen. Anybody has any idea why it won’t let me into the command prompt?

i”m very ntocias for you re infrmation so i still confuse this one how to reset password bios macbookpro, please help me i very needed youre helping

Hi ive tried these but nothing works for me.. Its a Mac os X 10.5.8… Can u please elaborate on typing each phrase what respond should there be on the prompt screen? Because am having errors each time. Pleasee helppp i really need the administrative password to update stuffs on the mac. Thanks

I just got this Mac is x from someone and cannot get past where it says username and password need to know how to reset everything without install disk please help

launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist wont work, says cant stat( or something like that, and when i do is users it also has nothing for me but failure. making it so i cant do step 6. any help?

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!!!!!!

Have Something To Say? Join The Discussion!

  (required)
  (required; will be kept private)
  (optional)