Reset a Mac OS X 10.7 Lion Password

Aug 24, 2011 - 23 Comments

Reset a Mac OS X 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”

Launch Terminal from Mac OS X Lion Recovery Menu

  • Type the following:
  • resetpassword

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

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
  • 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 a USB Lion install drive too, but it’s quicker to use the Recovery disk that is already active on OS X Lion installations.

Related articles:

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

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

    • MacGuy says:

      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

  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.

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

Shared on Facebook

Shop at Amazon

Ad

OSXDaily on Facebook