How to reset the Admin password on your Mac without a disk

Apple has official instructions for changing or resetting an account password in Lion (Mac OS X 10.7) or Mountain Lion (Mac OS X 10.8 ); however that tutorial either assumes you already know an administrator password or have a Mac OS X installation disk.

But that’s pretty pretty useless if you have neither the password nor the disk.  So in this article I wanted to show you two ways to reset the administrator password without a disk.  I think Macbook Air users will find this article especially useful just keep in mind that you may lose your files after running this tool; therefore, make sure you have everything backed up.

The two most popular methods of resetting the admin password on the Mac (without the CD) are:

  • Recovery Mode
  • Single User Mode

Recovery Mode

In Lion and Mountain Lion you can use Recovery Mode to reset the password.  Just restart the computer and hold down Command + r until the menu screen appears.  Click Terminal from the Utilities Menu and enter this:

resetpassword

Single User Mode

The other option is to delete the Apple Setup file to trick the Mac into thinking it just came off the truck from the factory.

After deleting the Setup File and rebooting, you’ll see a “Welcome to Mac OS X” setup screen which will walk you through the process of creating a new admin account.

To make it happen, we have to boot into something known as Single User Mode.  This is a limited environment with no graphical user interface but is very helpful when you need to perform advanced troubleshooting.

That’s what we’re going to do today.

Reboot the Mac and hold down Command + s to enter Single User mode.  Keep holding down Command + s until you see a black screen with white text.

The command prompt is that right rectangle near the bottom of the screen.  This is what it looks like on my Macbook Air:

Mac OS X Single User Mode

At the command prompt enter this:

mount -uw /

This mounts the root file system (the forward slash /) and tells the computer to change the status of any already mounted file systems (that’s the -u part of the command) and make sure it’s read-write (the w in the command).

Press enter to move to the next line and type this:

rm /var/db/.AppleSetupDone

This looks a little more cryptic than the mount command but it’s not too hard to decipher if you break it into groups.

The rm part removes directories.  In this case, it’s removing a directory that lives in a /var/db/ called .AppleSetupDone

Deleting this folder is the trick that forces the Mac to think it has a new lease on life.

Press enter to move to the next line and finish up with this command:

shutdown -h now

The dash h halts the Mac at a specified time, in this case we’re saying, “Shutdown Now

After executing this command, press the power button to turn the Mac back on and you’ll see the setup introduction screens.

About

Connect with Vonnie on Twitter

Posted in How To, Mac OS X 10.8 Mountain Lion Tagged with:
  • kahaba74

    Thanks for this but will all files and programs be retained, or does this effectively wipe the system?

    • All files remain

      • Chris Darrow

        YOU NEVER UPDATED THE POST WHERE DOES IT SAY THIS WILL WIPE ALL YOUR FILES!!!! I JUST WIPED ALL THE FIELS FOR ONE OF MY CLIENTS BUSINESS COMPUTERS!!!!!!!!!!

        • Jack Bone

          i think there is a file recovery app for that right?

        • moiz

          Do send a mail to me if you want to get your data back… No need for file recovery app
          moizbharmal(at)live(dot)com

        • blackHoleOblivion

          Data is almost always recoverable, with the right tools. A professional on these matters can help. Whatever you do (to those reading this), don’t go to Geek Squad, they’re overpriced and mostly clueless without the magical software that Best Buy gives them to use. Talk to a few people who work professionally in IT. If they can’t help, they’ll probably know someone who can.

  • Jason McNinch

    This wiped my files.

    • julio quinonez

      for all that loose their files I found a video showing how to recover all. just check it here.

      https://www.youtube.com/watch?v=mv9uPfu93Ng

      • Andrés Paredes

        wouldn’t it be redundant to do this since we all are here because we don’t have the admin password and want to have it reset? If I miss something I apologize and disregard this comment

  • Shane Berlinger

    This nearly wiped all the files I had, thousands of pictures and countless other thing, and didnt even work. DO NOT TRY THIS!

  • Max

    Thank you! It worked perfectly!

  • dave

    its not working properly needed some help … please help after this cmd rm /var/db/ .AppleSetupDone ….. no dir show nothing there what to do ???

    • Joseph Oliveira

      rm /var/db/.AppleSetupDone

  • goinnick1

    I do all of that an nothing seems to work its looked or something from rebooting need help asap

  • Pingback: Help! Lost admin password for Mac OS X server 10.9 - FAQs System()

  • MB

    I’m in single user but the last prompt is “:/ root#” It just sits there and reappears when I press enter. What am I doing wrong?

    • Joseph Oliveira

      Can you not type? It says you’re in the root of the machine. and you have “Super User (Sudo)” actions.

  • Steven Helms

    Held down command +s nothing happened. I own a Mac book Air 2012

    • Joseph Oliveira

      Did you physically turn the machine off and then turn it back on. After turning it back on. Hold CMD+S at the same time.

  • Jenn Grossman

    My 2009 IMAC was not recognizing my password and therefore not allowing me to login after I replaced the hard drive and restored it from a time machine backup. I did this coding suggestion and it started up like a new computer but after finishing registering it things got funky. It had me go through the registration a couple of times and now when I reboot it gets stuck at the blue screen with the pinwheel… Please help!

    • Joseph Oliveira

      Sounds like a bad Time Machine Backup.

  • Pingback: [ i forgot my mac password ] Best Web Pages | I-Recommend-Best-Web-Pages(NetizenOpinion)()

  • Capers

    I have yosemite 10.10 I am unable to login the admin user and pass are not working SOMEONE please assist me in resetting The guest will not allow me to perform functions that must be completed for work uh YESTERDAY!!! Help PLEASE Mac Air

  • Freebird

    Hi a week ago guy came in our store with MacBook Air (13-inch, Mid 2012) and problem is that he cannot do anything right now. Previously Windows 7 was installed and he tried to install OS X but all bunch of thing went wrong so now mac is looking for password which he doesn’t have. Problem is that Command + s is not working and I can’t enter Single User Mode.
    Can anybody help me or tell me what am I doing wrong?

  • Pcdigital Pcdigital

    Thank you, the first act worked for us. Keep up the good work!!!

  • Krissie

    So, I won’t be doing the Single User Mode method, since I don’t want to lose my files, but I’ve tried the recovery mode, and it just tells me my new password won’t save.

  • Cory Fiegen

    Hey when I go into single user mode it pops up and then goes away as if it’s been blocked anyway to get around? And when I do the other one asks for a password that’s not mine any help?

  • albania

    which is commandt in macbook air i cant enter just open restore mode pelase help

  • Arjen

    The single user mode will not wipe your files. By making the Mac think it’s a new setup, it will simply create a new account with administrator privileges. The files from the previous account are still there, but they’re inaccessible from the new account you created, because they are stored in another user’s folder.
    To be able to log in with your old account again, go to user manager (System Preferences – Users & Groups) and change the password for your old account. After that, login with that account and all your files should be accessible again.

  • werido107

    the password will work the only thing is that you have to put in your password then go up and click resart then try it out.

  • Pingback: Apple:Help! Lost admin password for Mac OS X server 10.9 – Apple Questions()

  • Grimsgrin

    What do you do when the command +s function doesn’t work???

  • Mihir Nayak

    Hi

    I followed this and now all that is happening is the grey screen with the apple logo and the rotating wheel.

    Please help me urgently !!!!!!!!

    Thanks!!!

  • argiecalimag

    Creative analysis , Just to add my thoughts , if your business require to merge PDF or PNG files , my wife saw a tool here https://goo.gl/389DjE.