Mac OS X recover lost root password
For the sake of security, recommendations say to have unique, complex passwords. Most people have a hard time remembering these and will eventually forget one. Forgetting the root password on a Mac system can seem devastating, but this recipe will show an easy way to recover.
If you have the password to an account that is an administrator on the system, then it is easy to recover the password using the sudo command. Open a terminal window and type:
sudo passwd root
and you will be prompted for your password (the user account that you do remember). Then you will be prompted for the new root password twice. That’s it!
The sudo command is a wonderful way to control who can do what on a system. In this case, since the user account is considered an administrator, the sudo command allows you (after confirming that you are who you say you are with the user password) to run a command as if you were root. The command we are running is passwd root which is the command to change the password for the root user.
If you do not have an administrator password, either, you can still reset the root password. Boot the system from the Mac OS X installation CD and select the Reset password option from the installer screen and follow the directions.






thomas bowen said on October 16, 2008
Daughter has only one account on Mac and doesn’t remember her password. I can’t load any new software. Any help? I tried the sh /etc/rc then passwd username it prompted me for a new password. I typed in the new password but nothing actually typed. It asked me to repeat it (even though nothing actually appeared) I typed in what I had the first time typed in reboot and after it rebooted, I went to daughters account tried to get in, but it said we didn’t have the right password. A little help would be nice. Thanks
jason myers said on October 29, 2008
this not only worked on the password problem but i never had to reload any programs thanks a million!!!!
Nikki G. said on November 25, 2008
OK I have a MAC OS X
Lost password
NO administrator account
Only One
Can’t find software
HELP
kathy said on November 27, 2008
Wow thank you so very much! It worked the very first time!
les said on November 28, 2008
i lost my disc.s for back up and for got pass word to get in to my mac g4
jB said on December 10, 2008
Bad Title!
In no way does this recover the lost password!
It is useful for resetting the password.
Important difference.
Ad said on January 2, 2009
Hi Can anybody help me? I couldnt remember my password to my ibook so i used this 1. boot computer and hold the “apple” key and the “s” key.
2. wait for terminal show
3. release keys
4. type without the quotes: “/sbin/mount -uaw”
5. press enter
6. type without the quotes: “rm /var/db/.applesetupdone
7. press enter
8. type without the quotes: “reboot”
9. press enter
which worked great but when i got into my ibook everything that was on it had dissapered!! can anybody tell me how i can get the photos and music back that is on the system somewhere my hard drive is only showing 5 gig available and im about 9gig missing if somebody could tell me how to access these files i would me most gratefull Thanks
Manda said on January 7, 2009
Will this work with filevault active?
rex2930 said on January 13, 2009
how do u no wth version of Mac Window base do u have i currenly los my passwork and my master password but tried everything wth u guys had down there Mac OS X 10.4 but do u do that if u cant get into your on Mac
rex2930 said on January 13, 2009
I realy need your help i am getting frustrated badly step 1 to 5 works fine but when i try to do step 6, is says the following rm/var/db/ : no such fle or directory wth am i doing wrong Please write back ASAP
keef said on January 29, 2009
thank you very much, your instructions worked a treat.
i was trying to delete some files that were locked and hidden inside an app. v frustrating for a control freak like me. now very happy your simple instructions allowed me to change the root password, which i had forgotten. still wondering what it was… ???
Mohit said on February 28, 2009
Thanks a lot . i helps. I was able to change my password. I am really new to mac and linux, so dont know so many commands
Anonymous said on March 9, 2009
I have a Mac Mini with OSX 10.5.6.
I have an admin password, and used your recipe to obtain another root password. However, when I try and log in the a new terminal window with the new root password it says “unknown command”
What have I done incorrectly?
Matt said on April 23, 2009
If my MAC is stolen how does this prevent anyone with a leopard disk from recovering my password for my file vault account?
ie: change root password, then change account password, then login, and steal company files?
Erkan said on May 7, 2009
Hi I can not acces command s . And forgot password and master and don.t have installation cd. Is there any diferent way ?
thomas said on May 14, 2009
i just baught this cpu and i dont have the cd but there is a password on it that i dont know what it is every time i try to download any thing it asks for it but i havent the foggiest. if any one knows how to get rid of this or knows any thing about these cpus please help im now ofically lost. please help me
Joe T Lor said on June 21, 2009
I can not start my G4 lost the password OS
Shiv said on July 4, 2009
well this is quite a simple one and might not work for you, but if you have any other account on your mac( admin) then you can simply
1. go to system preferences
2. select the user from the left sidebar
3.click reset password.
4. it will ask you for a new password.
in2town said on July 15, 2009
it is good to know that you can get advice, i recently lost my password so i will try this and see if it works
SK said on July 20, 2009
I want to reset password on my mac. Today morning it asked me to login with user name and password, it never asked me admin password. I entered the correct password but it is not working. I tried to reset the password and hint using OS X disk, but it still not accepting my new password. I can see the password hint changed, but whenever I try to do some administrative task, it will ask me admin password and reject it. Please help me to solve this issue. I can login to my account using OS X disk but when I will enter my admin password to do some administrative task it is rejecting my password.
carlos said on July 25, 2009
where do i type that? whats the sudo comand?
Anonymous said on August 12, 2009
Hi everyone,
I tried to reset password via….
1. boot computer and hold the “apple” key and the “s” key.
2. wait for terminal show
3. release keys
4. type without the quotes: “/sbin/mount -uaw”
5. press enter
6. type without the quotes: “rm /var/db/.applesetupdone
7. press enter
8. type without the quotes: “reboot”
9. press enter
But now it just comes up with a select language page and when I choose english it loads up the System Administrator account. I can not log in as anyone else even if I create new users. In this state I try to log out, shut down etc, but nothing happens. Does anyone know what has happened here. Help is so so appreciated.
Anonymous said on August 13, 2009
Thank You!!! You are our hero! This saved us such headaches! Our computer will not be a paperweight! Good luck to everyone!
George said on August 28, 2009
I need to reset my administrator password on my mac. I have followed instructions according to the apple website but it doesn’t work. When I attempt to open the install disc on the computer it asks me for the password. Kinda defeats the purpose, I don’t know the password. Is there anyway around this or am out of luck.
Please help
Anonymous said on September 12, 2009
I recently bought an iMac G3. Ido not know the password. I am using a windows keyboard. When I boot m mac the windows + s has no effect! If you can please help me that would be great.
Anonymous said on September 17, 2009
After you type the above commands and reboot I notice that the white screen shows up for 30 seconds then boots into original user. I never see the prompt I just type the commands but never see any typing but it does reboot when i hit enter I am using an external screen.
Am I supposed to enter a password when the white terminal screen shows up?
Please help
Anonymous said on September 19, 2009
i have a imac with 10.5.8. i just bought an old imac g3 with 10.3. i dont have the passwords for the g3. i have taken the hard drive out and connected it to my new imac. but i still can not change the passwords on the hard drive. is there a way to do this.
Mike said on November 11, 2009
Worked like a charm! Thanks!
Anonymous said on November 21, 2009
IT WORKED
U THE MAN
Anonymous said on November 26, 2009
hm…interesting…
Joel Garfield said on December 14, 2009
This was very helpful. Thank you. I forgot the password to my old iMac, lol. Thanks again.
zadova said on December 23, 2009
This one worked fine on a recent (Nov 09) iMac with MacOSX 10.6.2 of a friend who had forgotten his initial admin password account: Thanks “lewisj”
1. boot computer and hold the “apple” key and the “s” key.
2. wait for terminal show
3. release keys
4. type without the quotes: “/sbin/mount -uaw”
5. press enter
6. type without the quotes: “rm /var/db/.applesetupdone
7. press enter
8. type without the quotes: “reboot”
9. press enter
The computer reboots as if it was brand new and I could create a new admin account. The guy had only used it one day so nothing was lost when I erased the account with its lost password.
Nelly said on December 26, 2009
I have tried everything I have read on here but my admin password does not seem to be erased. Every time I go back, it still there and waiting for me to type it in but forgot the damn password.
I do need serious help because I cannot install anything, And when I ran the disk, it deleted everything operating to an old system not updated. So no current flash or office working. :( Need serious help to unlock the admin password and get a new one.
Some give me some better instructions. I have done all I read on here and some others from somewhere else successfully going through it but I still find the password hint waiting for me..
Can anyone help please..
Anonymous said on December 31, 2009
For some reason my Mac won’t accept my password though I have not changed it. I have my original start up CD and have tried as per mac instructions to reset password + I have gone through the internet trying everything suggested with the same results; it keeps asking for the original password/the password I’m putting in is incorrect!
Anonymous said on January 1, 2010
Hi, my problem is that i cannot type any command while the installation DVD starts the installation up, so i cannot access neither the Utility or the Single user mode…
Any Hints?
Anonymous said on January 4, 2010
hello
i forgot my password , i musing mac os x 10.6
and want to change my password but i forgot password .
thanks
Anonymous said on January 10, 2010
hello i got a big problem i hope someone can help me..
i bought i mac pro from someone i wanted to change the account that i did with no problem and then i wanted to change the login code. i did that by using the cd everthing worked fine but when i reboot my system i cant login anymore. my password is “wrong”. i tried to restart by disc wont work. i tried to do it without cd with the cmd+s wont work either. any button when i reboot the system wont work. I really dont know what to do and i really hope someone could help me! because i just got mij mac and i dont want to trow my money away.
thanks
Anonymous said on January 22, 2010
We’re talking about Macs here, you spam-bot.
Anonymous said on February 18, 2010
ok so I do not have an admin account and I need to reset the root password, other ways??
Anonymous said on March 9, 2010
Thank you so much , i recovered my root password.
Jeff said on April 7, 2010
And this is why people are forced to use captcha.
Jeff said on April 7, 2010
Your original account is an administrator account. If you have your install disc there’s a reset password option. See here: http://support.apple.com/kb/ht1274
Anonymous said on May 10, 2010
What if I do not have the install CD?
Anonymous said on May 25, 2010
1. Insert the Mac OS X Install disc and restart the computer.
2. When you hear the startup tone, hold down the C key until you see the spinning gear.
3. When the Installer appears, choose Utilities > Reset Password.
4. Follow the onscreen instructions to change the password.
5. Quit the Installer and restart your computer while holding down the mouse button to eject the disc.
Anonymous said on June 8, 2010
Thanks, Marckdon. That’s great information to add to this tutorial!
Prodigal_1 said on June 20, 2010
Take Note, this will also erase all programs, files and media. You will have to reinstall from Time Machine or manually reinstall all desired files!
Bryancommeaux said on July 10, 2010
i hav a mid 2010 mac mini i reboot the osx but there is no option to reset password after clicking utilities it just takes 45 min to reinstall the osx.
Mcdojan said on July 28, 2010
Lost admin password. Cannot reboot on OSX install disk. I have upgraded to 10.58 but the install disk is 10.3 and it won’t allow me to boot from it.
Sharonte_r said on July 29, 2010
Hello,
I bought an Apple laptop from my job (thrift store) & it has a promt password, is there any way I can figure it out or change it without knowin the previous password?
Laurel 1234 said on August 17, 2010
How would you do it if you don’t have the CD?
Anonymous said on August 25, 2010
you can try to google Password Genius
unclenice said on September 2, 2010
Thanks man your tut really helped save me alot of grief cheers and to the whole people here with their input you *ROCK* guys cheers.
Anonymous said on September 3, 2010
Last time I forgot my password and tried everything i could do but failed, until I found this great tool Password Genius. It works great, and you can google it.
aroo-roo-roo said on September 9, 2010
Hi I ran a clean on my laptop and accidentally deleted all keychain names including my administrator name. I know the password but I don’t remember my admin name?? I would really appreciate if someone coul help with this. I can’t get updates or anything because I don’t know the admin name but i do know the password …what a problem eh?
Bollywood21m said on September 11, 2010
Dear Expertise ple help..I am suing Imac version10.5. As there was some problem in display i was suppose to take my imac to services dept. Now, i dont wanted to give away my personal data so i have deleted my user account with the home folders. Now i have a doubt tht is it possible to get the user account wid the home folder easily or it is not possible or if possible then how much time will it takes. As the user account or folder is not be deleted from trash..so ple guide me or suggest me what shld i do to save guard my data. thx.
Joseamedina10 said on September 13, 2010
I CAN NOT OPEN A TERMINAL WINDOW/TO TIPE THE SUDO COMMAND
sm535 said on September 21, 2010
I am using Mac OS 9 and have the same problem. But pressing ‘apple’+'S’ key does not send me to the single user mode in Mac OS 9 – it shows me a screen with a picture of harddisk, a circular arrow and a straight arrow. The harddisk icon is not clickable. The straight arrow proceeds with the boot (leading to a login screen that do not remember password of). I am not sure what the circular arrow does.
Can someone help?
Homas45 said on October 6, 2010
I have a macbook pro with tiger 10.4 on it its a A1278 model The admin password was change now I cant boot grey screen My dvd os x is broken cannot get to boot please respond thankyou what shall I do
Alexa44 said on October 18, 2010
Thank you so much
Mrtauch779 said on October 24, 2010
i have imac osx 10.4.11 cant unlock file value/ my kids play game try download game /so they deletd some things / now only 4*4 screen log in at adminadmin /// you are unable to log into the user account ‘adminadmin’ at this time. i need help i try everthing seem didnt work so help me i got only 1 computer .thank you.
Onur said on December 14, 2010
are you stupid or what? The product you are advertising is forWindws. The discussion here is about Mac.
Anonymous said on December 14, 2010
Sorry, we missed this spam the first time. Now deleted.
mjdl23 said on December 19, 2010
Thanks for this! I recently lost my root password and I changed it using this method. :)
Mannyceo13b said on January 9, 2011
i got an imac for free and i think i now know why it’s maybe becauce it’s password protected so i don’t really know how to over ride it all that i can really think of doing is installing the os but in order to do that it says that i need an andmins name and passward which i don’t have so my only real option is to open it up and install a new hard drive i would suppose
Nathan Brown said on January 18, 2011
so i did the whole type stuff in to reset the add min user thing and it work but now after the step where it asks to make a admin account it restarts the video does any one know what i did wrong
Michael said on March 13, 2011
All I want to do is out my admin password not reset HELP!!!!!!
Aaron Wilson said on March 26, 2011
worked like a charm, thanks.
Norberto M. Tiongson said on May 15, 2011
Pls. help me to reset my log in password. I brought it to apple service provider here in the Philippines.and bought installer disc. but my CD ROM has a problem and not spinning. I had also installer disc which I used to upgrade mac OS from tiger to leopard. but this leopard installer now don’t run.
any help that u can extent to me is highly appreciated
Anonymous said on May 15, 2011
If you can’t get your optical disc drive up and running, you could always have somebody mount the OS X installation on a USB drive and mount from it instead.
Anonymous said on May 15, 2011
See if this helps…http://www.tech-recipes.com/rx/2628/install_os_x_from_dmg_file/
Romi Savini said on May 15, 2011
Hello, you can help me?
I did what you said but I made a Huge mistake and erase my user and appears a: “no such file or directory”
additionally, I think that my CD reader does not work so i cannot reinstall the OSX 10.5
OH good, any help would be amazing. I have to write my dissertation so … well i am not in my best moment!
Romi
Giada Condor said on May 23, 2011
Do not waste
time ..
to find
all types
of passwords (except myspace) please
contact me, but
only if
it comes to
good causes! giada.condor@hotmail.it
Sarrithkumar said on June 23, 2011
Hi All,
I’ve Mac OS X OCEG4, actually i was using this last some years and important datas also there. Now the problem is, I forgot user name as I knows the password and the hint also… I don’t know how can I login in to… pls help me…
Phil said on August 8, 2011
I tried all the other methods and this is the only one that worked and it was easy. I doesn’t let me create another password for the administrator but it does allow me to set up my own password and identity and I have full access to the computer. I didn’t lose any files or programs as was mentioned in another reply that I saw. Thank you so much!!
pumpkin said on November 5, 2011
I have a Mac mail account. I opened several years ago.
It was Not connected to a computer.
I cannot figure out how to find my forgotten password.
Can you help?
Christopher Levins said on November 12, 2011
@zadova OMG YOU ARE SO AWSOME THANKS SO MUCH I FINALLY GOIT IN MY MAC !!! THANKS!!!