Reset a Mac OS X Mavericks or Mountain Lion Password

Aug 24, 2011 - 51 Comments

One of several changes to newer versions of OS X 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, and for some added security you now must access a password reset tool through the command line in Recovery Mode. Don’t let the command line sound complicated though, because it’s really quite easy to use, and we’ll walk through the entire process for OS X Mavericks (10.9), Mountain Lion (10.8), and Lion (10.7).

Reset a Mac OS X Password

We’re actually going to cover two tricks, and they will work with or without internet access, and do not rely on any third party tools.

Method 1 – Reset a Lost Mac OS X Password with Recovery Mode

Important: You have to boot from a Recovery drive for this to work, andthe Mac must be running OS X 10.7, 10.8, and 10.9. New Macs include a native recovery mode option through a boot partition, but a recovery disk or boot drive made yourself will work as well.

  • 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”

Launch Terminal from Mac OS X Recovery Menu

  • Type the following:
  • resetpassword

  • Confirm the user account and then the password change and reboot Mac OS X as usual with your new password

This replaces the “Reset Password” menu item that used to be in place prior to OS X , which was around in Snow Leopard and before, and one of two original methods of resetting a forgotten password through more technical ways. Why the change to the Terminal method with newer versions of Mac OS? Probably for increased security, particularly now that recovery partitions are standard with Macs.

The above method is by far the easiest, but if it’s unavailable for some reason, you can choose this secondary trick.

Method 2 – Delete AppleSetupDone and Create a New Administrative Account

Much like prior versions of Mac OS X, the newest OS X releases share a more untraditional and technical approach to resetting a password for user accounts. In this case, you can still delete the AppleSetup file which forces the “Welcome to Mac OS X” setup assistant to run again, thus allowing you to create a new administrative account. You can then login to that new administrative account and reset your original account password, or just copy your old files over if that’s what you’d rather do.

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
  • Reset a Mac password from System Preferences

  • 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 from a Mavericks, Mountain Lion, or USB Lion install drive too, but whenever possible you will find it is much quicker to use the Recovery disk that is already active on all normal OS X installations.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Mac OS X, Tips & Tricks, Troubleshooting

51 Comments

» Comments RSS Feed

  1. Peter says:

    Why would Apple hide the previous tool? It was so much easier. Very strange move.

  2. Cle, says:

    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.

    • Tinman says:

      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.

  3. MuTz777 says:

    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

  4. angstwad says:

    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.

  5. boom says:

    When I type:
    rm /var/db/.AppleSetupDone in Recovery’s Terminal, it says “No such file or directory” Please help!! Thanks.

  6. [...] sprawdz tez to latwiej Reset a Mac OS X 10.7 Lion Password Komputer: Macbook AIR 1.1 Cytuj   + Odpowiedz na ten temat [...]

  7. [...] 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 [...]

  8. BruceJ says:

    rm /var/db/.AppleSetupDone won’t work, because you’re booted from the recovery disk.

    The file is in /Volumes//var/db

  9. BruceJ says:

    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.

  10. [...] 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 [...]

  11. [...] 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({ [...]

  12. ShivD says:

    Thankyou!!! You are a life saver!! Method 1 worked. I was done in seconds!!!! :D

  13. [...] 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 [...]

  14. Robert says:

    Thanks!
    This saved my night sleep.

  15. dump joke says:

    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

    • jemm says:

      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.

  16. Chris says:

    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

  17. Taylor says:

    Thank you very much. The first method worked great.

  18. Trevor says:

    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.

  19. Fernando says:

    This worked effectively thanks!

  20. Anthony says:

    Fantastic! Method 1 worked! Many many thanks!

  21. Jake says:

    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

  22. MV says:

    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?

  23. john santana says:

    Thank you, you are genius

  24. Mario says:

    Thank you so much !!! It works, FYI set the Firmware Password administrator !!! CYA

  25. Arcadian says:

    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

  26. Kairat says:

    Thanks, it’s really helped. I’m happy.

  27. Adele says:

    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.

  28. Nok says:

    Thank you very much. The method 1 worked!!! I’m so happy! ;)

  29. Linda says:

    yeay method 1 worked!!!! thank you a lot!

  30. Laffdaffie says:

    Total life saver!!
    Thank you!!!

  31. Jes says:

    Thank you so much!

  32. Carla says:

    What does “at boot” mean?

  33. [...] need to reboot to perform this, and then use the same resetpassword utility that is used to change passwords in Lion, but instead choosing a hidden option. When you [...]

  34. Arda says:

    when i cmd-r it automaticly connects internet recovery and gives an error called -”4403F”. I tried to press option key to select “HD recovery” but just Macintosh HDD. I cannot find Utities tool to reset my password..
    Any help?

  35. Steve M says:

    My wife is about to throw her new iMac out of the window. It is asking for a password. She never put a password on her computer. Seems the computer upgraded itself recently and a password box after bootup is there. No passwords that are remembered work. The Apple ID password does not work. Cannot reset without knowing what the password is. Whose stupid idea was this? Some people on this thread say “oh, the first method worked without saying what the first method was! Anyway, we don’t want a password on this computer!

    • Frank Dino says:

      Passwords do not assign themselves to Macs or any other computers for that matter. Computers do not think for themselves, they take action based on our commands. To require a password at login is a setting that must have been turned on by someone, perhaps they forgot doing so. No bother, follow the instructions to reset your password and be on your way.

  36. Crystal002 says:

    Will method 2 work to permanently change admin when changing ownership of machine

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates