Reset a Mac OS X Mavericks or Mountain Lion Password

Aug 24, 2011 - 66 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.

.

Related articles:

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

66 Comments

» Comments RSS Feed

  1. Aaron says:

    I bought a Mac book Pro from eBay and I forgot my password, a friend said he could unlock it, now he has given it back to me and it says disabled try again in 59minutes, but never gives me the chance to try again, when I tried command r, a firmware password comes up that the previous owner must have put on, I’ve tried so many times to contact the previous owner but can’t get on to them, am out $600?

  2. Shahin says:

    Password reset

  3. Grebbox says:

    Can’t reset admin password using methods 1 or 2 please help me. I’m running Mac os x naresh 10.8.5

  4. Raymond Chan says:

    My Mac Mini uses a generic external keyboard. What are the keys on a generic keyboard that correspond to the Command key and Option key in the above articles please?

  5. nickon says:

    i have a macbook air. when i press cmd+r then insted of the other apple logo it says,something like internet recovery and shows a error loading.what has happened plz guyz reply me fast.i am unable to install the things that i want.

  6. tress worthington says:

    Forgot password on lion 2007 model any suggestions

    • Amazing says:

      Yes the best way to reset a forgot password on a Mac with Lion is to read the instructions above showing how to reset a password in Mac OS X from versions of Lion, Mountain Lion, Mavericks, etc.

  7. Daniel says:

    After I entered resetpassword, there was no volume/user account to select. What do I do now?

  8. Julie says:

    You literally saved years of memories! Thank you so very much for posting this!

  9. Jaci says:

    I just got my stolen MacBook Pro back thx to Find my iMac … They changed the settings to their name and password as administrator and I can’t reset it with any of the techniques I’ve read on here … Can anyone help please ?

    • yessi says:

      Yes, create a new administrator account, and delete the one the thieves made. Links are in the above article to demonstrate this.

  10. MidoTaha says:

    PLEASE HELP

    My mac running Yosemite 10.10.2 (14C109)
    When I hold shift + R, windows appear but no (terminal),
    Please advise

    • consto says:

      Reboot and hold OPTION, then select Mac not Windows? Why are you booting Windows to reset a Mac password?

  11. ellios says:

    what was method -?

  12. Tyrone says:

    Seems to me that there should be a warning that if you want anything more than to hide something from your baby sister you need to add encryption of some kind because the normal password is but a mere speedbump for thieves and offer NO peace of mind. #falsesecurity

  13. Crystal002 says:

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

  14. 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.

  15. 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?

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

  17. Carla says:

    What does “at boot” mean?

  18. Jes says:

    Thank you so much!

  19. Laffdaffie says:

    Total life saver!!
    Thank you!!!

  20. Linda says:

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

  21. Nok says:

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

  22. 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.

  23. Kairat says:

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

  24. 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

  25. Mario says:

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

  26. john santana says:

    Thank you, you are genius

  27. 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?

  28. 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

  29. Anthony says:

    Fantastic! Method 1 worked! Many many thanks!

  30. Fernando says:

    This worked effectively thanks!

  31. 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.

    • ted says:

      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.

  32. Taylor says:

    Thank you very much. The first method worked great.

  33. 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

  34. 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.

  35. Robert says:

    Thanks!
    This saved my night sleep.

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

  37. ShivD says:

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

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

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

  40. 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.

    • Monk says:

      Yes but how would I know the name of my boot volume?

    • Llew says:

      Tks – my boot volume name is Macintosh HD (likely a default). How do I format the space in this command when entering after Cmd-S restart?

      • Bob says:

        You need to put a backslash after the space –
        cd /Volumes/Macintosh\ HD/
        you can also run “cd /Volumes ; ls” to see the name of your boot disk.

  41. BruceJ says:

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

    The file is in /Volumes//var/db

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

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

  44. boom says:

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

  45. 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.

  46. 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

  47. 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.

  48. Peter says:

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

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

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

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site