Reset a Mac OS X 10.7 Lion Password

One of several changes to Mac OS X Lion is how resetting passwords is handled, previous versions of Mac OS X would have a password reset tool easily accessible from the Utilities menu but that isn’t available anymore. There are still multiple approaches to resetting a lost user password in OS X 10.7, this walkthrough will cover two different methods, the first is unique to Lion and the second is a traditional workaround to reset a password.
Method 1 – Reset a Lost Mac OS X Lion Password
You have to boot from a Lion Recovery drive, this can either be a recovery disk made with the Lion Disk Maker tool, or just by booting from the built-in Lion Recovery HD partition.
- Hold “Option” at boot and select the “Recovery” disk at the boot menu
- Wait for “Mac OS X Utilities” menu to appear, indicating that you are booted into recovery mode
- Click on the “Utilities” menu and select “Terminal”

- Type the following:
- Confirm the user account and then the password change and reboot Mac OS X 10.7 as usual with your new password
resetpassword
This replaces the “Reset Password” menu item that used to be in place prior to OS X 10.7, which was one of two original methods of resetting a Mac OS X 10.6 or prior password. Why the change to the Terminal method? Probably for increased security now that recovery partitions are standard with Lion.
The above method is by far the easiest, but if it’s unavailable for some reason, you can choose another method:
Method 2 – Delete AppleSetupDone and Create a New Administrative Account
Mac OS X 10.7 does share a more untraditional approach to resetting a password as past versions of OS X. In this case, you can still delete the AppleSetup file which forces the “Welcome to Mac OS X” setup assistant to run again, which allows you to create an administrative account. You can then login to that new administrative account and reset your original account password.
From the Recovery Drive’s Terminal, type:
rm /var/db/.AppleSetupDone
Then reboot either through the menu item or by typing ‘reboot’ into the command line.
Follow the setup procedure as usual, create the new administrative account, and wait for Mac OS X to boot as usual into the new user account. You won’t see any of your familiar files or settings yet, and this is normal, because you have to reset the original password. Here’s how:
- Open “System Preferences” and click on “Users & Groups”
- Click on the lock icon in the lower left corner and authenticate, allowing you to make changes to user accounts
- Select your original user account from the left side Users list, and then click on the “Reset Password” button on the right
- Enter and confirm the new password
- Close out System Preferences and reboot

You can now login to the original user account with the new password you just set. Once logged into your original administrative account you can then return to User & Groups and delete the temporary admin account you created.
These two methods should work when booting a USB Lion install drive too, but it’s quicker to use the Recovery disk that is already active on OS X Lion installations.

Why would Apple hide the previous tool? It was so much easier. Very strange move.
Please confirm something. If the mac has full disk encryption enabled, then you’d still need a password at boot before you got a chance to boot in the recovery partition i hope? Because if not, that would mean disk encryption is useless.
If you have full disk encryption on there is no way any of these tips will allow the changing of the password as without the password you can’t unlock the disk in the first place.
Without the password you would need the encryption recovery key which you should have kept in a safe place, but not on the encrypted hard drive–obviously.
Considering how trivial it is to change a password in OS X, without even knowing the existing password, I would never run a system that has any personal or business data on it without using encryption.
Hey what happened to the pressing Command+S in the startup (I guess its called booting into single-user mode or something) and then using the “passwd username” command? That was whole lot easier! Does it still work?
Thanks
passwd username works, along with all of these — but you still have to have the original password to reset the keychain pass, am I correct?
That’s the biggest PITA of all — not resetting the password but having to create the new keychain and re-adding all your info to it.
When I type:
rm /var/db/.AppleSetupDone in Recovery’s Terminal, it says “No such file or directory” Please help!! Thanks.
make sure there is space between rm and following codes. rm(space)/var/db/.AppleSetupdone
just to make sure before youtype it type /sbin/mount -uw /
please check the space
P.S. This works on Single user mode. cmd+S upon booting not on terminal in recovery mode
after all this, i still cannot ‘authenticate’ I have all the correct information
[...] sprawdz tez to latwiej Reset a Mac OS X 10.7 Lion Password Komputer: Macbook AIR 1.1 Cytuj + Odpowiedz na ten temat [...]
[...] Mac OS X Lion has changed how several helpful troubleshooting tools function, one being the reset password tool, and another is how Apple Hardware Test (AHT) mode works. Gone is AHT’s independent boot mode [...]
rm /var/db/.AppleSetupDone won’t work, because you’re booted from the recovery disk.
The file is in /Volumes//var/db
Damn filters, I forgot and used angle brackets…
The file is in /Volumes/[Name of boot volume]/var/db,
And I know it works, I just did it.
Yes but how would I know the name of my boot volume?
[...] OS X, Tips & Tricks, Troubleshooting – September 19th, 2011 – Leave a Comment There are a few ways to reset a password in Mac OS X 10.7 but both of those methods require reboots. This approach is different, it lets you change the [...]
[...] case, you can use methods to reset a forgotten Mac password to get around the user login completely (instructions for OS X Lion are slightly different). stLight.options({ [...]
Thankyou!!! You are a life saver!! Method 1 worked. I was done in seconds!!!!
[...] from resetting a Mac OS X Lion password with the passwordreset command line tool or by creating a new user account, you can use a new [...]
Thanks!
This saved my night sleep.
my brother thought he would play a joke on me and change my log in password and he completely forgot the new one i have try’d every thing but all i end up with is a grey screen with a pad lock in the centre of the screen and a dialog box under it help some one please
Sounds like you have a firmware password set, boot into recovery mode with Command+R and pull under the Utilities menu to see if it’s enabled.
Hey I have a brand new 13inch MacBOOK Air and my password is totally forgotten i can get as far as turning on my computer but no further then the enter password screen. Please does anyone know how to set a new one without having the old one. Holding OPTION doesnt do anything. Thankyou
Try holding Command+R to boot into recovery mode
Thank you very much. The first method worked great.
I have full admin access but when i select the “mobile” user i wish to change the password to, there is no reset password button. Although it show up for all other accounts. I’m running everything up to date.
You cannot reset the password of a mobile account locally, it needs to be changed in the directory service to which the computer is bound.
This worked effectively thanks!
Fantastic! Method 1 worked! Many many thanks!
I foolishly changed my sisters password and now I cant remember it. She is still logged in and can use her iMac, if I do method one and I log out will this work on a her comp? she does have Mac OS X Lion. but i want to be sure otherwise im out 100 dollars
please respond asap I need this help badly
Hello, I hv a MacBook pro with OS X 10.7.3. I unknowingly setup parental controls on the only admin account. Now there is no way to disable parental control or create another admin account. What can I do to get out of the tangle?
Thank you, you are genius
Thank you so much !!! It works, FYI set the Firmware Password administrator !!! CYA
Firmware password will not let me boot up from Command , Option P+R, Or any command+option wont work or let me boot up from cd or usb or dvd, what can i do?? Apple says i have to bring it in to redo the firmware password, which is about 4 hours away i dont want to drive that far, again. arrrgh!!!
Help! please
Thanks, it’s really helped. I’m happy.
I had a hard drive crash about a month ago, had a new one installed (thank God for AppleCare). My external hard drive had not successfully stored my time machine for about 3 months so when I restored my old info it loaded up an old adimin password. Thus I am now in the same predicament as all these others, however, despite trying method one and two I am getting nowhere. I have been able to reset password using method 1 but when I “restart” I get a gray screen with an apple. I have had to reboot from Timemachine which of coarse puts me back to the old password. How can I get my desktop back after resetting the password without having to reboot with time machine? I have tried; “restart” option under the apple menu, reboot from selected drive and at the launch selecting to reboot with Mac HD. All lead back to gray screen unless I spend hours letting it reboot with time machine. Please help ASAP, I am on my third day trying to fix this and am about to pull my hair out. Thanks.