Reset a lost OS X password
If you’ve forgotten your Mac’s admin account password, don’t worry. Assuming you haven’t locked out OpenFirmware, it’s a pretty simple task to change your password back to something you know.
Here’s how:
- Hold Apple+S when booting to enter single user mode
- #sh /etc/rc
- #passwd yourusername
- #reboot
If you can’t recall your user name, you can either look in the /Users folder (the directories are named by user), or run “niutil -list . /users”.
Also, on older systems the /etc/rc script isn’t available, apparently. If that second step fails, try mounting and starting the base services manually:
- #/sbin/fsck -y
- #/sbin/mount -uw /
- #/sbin/SystemStarter
Another method:
Here’s how to create an admin account without knowing the current administrator password.
This process basically forces your computer to re-run setup, which is what you see when you setup a new Mac.
If the computer doesn’t have an Open Firmware Password, that this should work fine. If it does, than you’re out of luck
Step 1: Boot in single user mode (Single user mode bypasses the GUI, which is all the visual stuff, and gives you something called “root access”) by pressing Command + S (Apple+S) when the first shade of blue appears on the screen, and holding it down until the screen turns black with white text.
Step 2: Wait for all the code stuff to load. Now, the first thing we need to do in single user mode is mount the hard drive so we can edit it. You enter this command in : /sbin/mount -uw /
It should say something about removing orphaned unlinked files.
Step 3: We are going to delete a little file that tells your computer every time you start up that you’ve completed the setup by entering this command: rm /var/db/.applesetupdone
It should just bump down, waiting for the next command if it worked.
Step 4: Now type, reboot
Step 5: It should shut down and reboot. Than, a setup window will appear, asking you what language you want your computer to be in, just like you see when you setup a newly purchased Mac.
A welcome video will play after you select the language. It has some pretty cool music, but if your in a room with other people, I’d mute it right after the video starts, or have headphones handy.
Step 6: Setup the computer. Select “DO NOT TRANSFER MY DATA”. Don’t worry, all your old stuff will still be there. Choose your internet connection and network, here is where you need your WEP or security password if you have one.
Step 7: Create a new local account to administer that computer. You usually want to enter the name of the computer as the longname, and the shortname what you’ll log in as. Say your computer’s old name was “Frank’s Computer”, than just put Frank as the longname, because it will automatically as ” ‘s Computer” at the end. MAKE SURE THAT BOTH USERNAMES ARE DIFFERENT FROM THE EXISTING ONES, OTHERWISE IT WILL OVERWRITE.
Step 8: Finish the setup, and you should automatically be logged into your new administrator account.
on August 17th, 2009 at 10:23 am
Thank You! Worked like a charm! 😉
on August 19th, 2009 at 9:20 pm
great info
on October 2nd, 2009 at 7:15 am
Thanks a million. First two didn’t work for me but ‘another method’ did.
Can’t thank you enough….
Jim
on May 11th, 2010 at 5:15 pm
Thanks,
great info
on November 7th, 2010 at 11:40 am
worked awesome thanks a million
on March 29th, 2011 at 6:24 pm
i tried the first two out, but i really don’t think i’m doing them right since the system just went to the log in screen, same as ever.
most of the success stories with these methods come from the “another method”, and i’m fully willing to try it- i just have a precaution. if i try “another method” and completely reset back to a new mac startup, i’m assuming all my files and such will be gone? if you could email me or reply to this with @emily or whatever, that would be really, really great. thanks!
on September 26th, 2011 at 1:59 pm
This is not working for me! I get to the black screen with white writing and it only allows me to type into a field prefaced by “:/ root#” I begin the steps and nothing happens. This is pretty urgent. Any tips?
on April 21st, 2020 at 7:59 pm
The “another method” was the only thing that worked for me. 2005 ibook G4. No data loss as far as I can tell.
Thanks for helping me get my old music back!