Technology

I’ve 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

I’ve had to do this a couple of times for friends when they’ve bought a second hand machine, and once when I had a momentary brain lapse and forgot my own password. Works like a charm, though you’ll loose any passwords stored in your keychain.

138 thoughts on “HOWTO: Reset a lost OS X password

  1. Note that you will also lose access to your home directory if you are using FileVault. FileVault keeps your home directory in an AES encrypted disk image so if you really do forget that password kiss the contents goodbye.

  2. help i bought a old macbook from a girl and she didnt tell me the main password now i cant get in touch with her! i tried the 2 things above and it didnt work! when i tried to start up with comand key and s its just stayed grey forever. so i opened command promt in the system as it auto loggs in and triedboth and still couldnet get it to work! I just wanna format it back to new with just the operating system and clean off all her crap can anone help?? i dont have the cd can i download it to do this from somewhere?

  3. On Leopard to resed just enter in s mode.

    type

    /sbin/fsck -y
    /sbin/mount -uw /

    passwd (username)

    it ask 2 times for password

    reboot

    After go into the system preferences/account and rester the password.

    Regards

  4. This method worked perfectly. I was able to reset the admin password without a CD by following the directions above.

    THANKS!!!

  5. i just bought a mac book pro10.4.11 from some one i cant get in touch with now and i dont have the disks or the passwords. ive tried some of the things ive read above but nothing worked this is my first mac and im clueless on what to do but i read some thing about firm ware and i thought maybe i followed those steps right but the firm ware didnt allow me to reset can any 1 help ps i dont know what firm ware is or even if i have it. thanks

  6. So everything looks like it going as planned but i get confused when:

    localhost:/ root# passwd (username)
    >

    So i type in a “passwd” twice so it looks like”

    >example
    >example

    And as explained i type in:

    >reboot

    and nothing happens. I hard reboot using what i think is the username (displayed in light gray under the apple) and the new password i think i set, and nothing.

    Am i F’ing up somewhere?

    Thanks,

    Dizzle

  7. can anyone help me?
    i just bought asus eee pc. OS linux.
    i set up password and after i reboot the eee, login failed!!
    my password wrong?
    helppppppppp… how to reset lost password asus eee pc?
    thanksss

  8. Hi guys I just bought an IMAC G4 power pc(version 10.3.9) but I have no idea what the password is, I dont have the boot CD and I cannot boot it into single user mode, what can I do?????

    Thanks!

  9. I have a macbook i followed these instructions and when i type in new password twice nothing shows and then it says sorry after i press enter what is going on? plz help.

  10. i follwed the instructions everything went fine, except when i retype the pasword everytime it says sorry and of course it doesn’t work after i reboot. Any suggestions?

  11. hi i recently bought a power book off someone and they no longer live in this country and i cant get in touch with them, can you help.

    i cant reset the password and ibeen trying desperatly what you said on the screen, i dont have disk either and can only get to the point where it says sbin/mount, after that process i type in passwd and user name but nothin happens

  12. If you can’t remember a user name, where exactly are you supposed to run “niutil -list . /users” ? Also, when running single user, the first line “#sh /etc/rc” comes up automatically on my system (OS 10.4.10). If you type that out, it reboots and takes you to the blue screen.

  13. Got a Mac Book Pro from a bud.. No disc, tried method of resetting password, but not It is starting up as if it needs to go through setting up mac for the first time out of the box. I try to connect wifi and register it, but it doesn’t work.. Can someone help please.

    jay

  14. ok so i have a mac os x ibook g4 laptop with no discs and i dont no the password can anyone please explain to me how to reboot it please anything will help if u would like to help me and be a good person email me at edthekid214@aim.com thank you

  15. i got a macbook myself & when i try to reset the password & type in sh /etc/rc at single user mode it goes through its paces then it doesnt ask for the password it goes all the way to a blue screen with no login on it just the pointer icon please if someone can walk me throught this on yahoo or msn id be glad to hand out my screename for some help

  16. every time i try to e-mail someone the ibook won;t let me asking for password and i don’t have it or the cd

  17. Hey I bought a mac g4 off craigslist and i cannot get in touch with the original owner i need to reset the master password can anyone help.

  18. If you get the Sorry command you are not typing in the correct user name. Look again at the username and make sure you have typed it in fully.

  19. Wow thank you I’d completely forgotten my password and this worked perfectly, once I figured out not to type the # marks (my first time using command prompt obviously). Thanks!!

  20. Hi everyone!

    I have for the past two days tried to reset the admin password. I have a PowerBook G4 (OS X 10.4.9) i’ve had it for just over a year and there was never any issues as i was asked what i wanted on it and it was there. I recently got a new ipod & needed to upgrade my itunes – yet for some reason i can’t because i need admin rights! I didn’t have the install disc which i read i needed so i went back to the place i got it from only to find they are no longer there. Sooooooo i asked around and got install discs from friends which happen to be other versions and none work. I stumbled upon this page tonight and for the last 2 hours have been following the advice to no avail. If someone would be REAL nice & contact me in regards to this i would really appreciate it.

    Thanks in advance

  21. I have tried doing this password reset every way that I can find but I just can’t seem to do it. I’m new with Macs. All I know is that I have an iMac G3 with OS X 10.2, I have no disks, and I needs to reset the main root password. Please email me specific instructions, perhaps with screen shots. Thanks! daniel_1992@msn.com

  22. please someone help, i just bought a mac book though the loot, it was fine when i was looking at it with the person who sold it to me, but when i got home i had lost the paaper with the password onit, his number is not anwsering and i have no way of contacting him…. plus to make matters worse i have no disk with it…..

  23. got it from a friend no disk no password..everything works great on it..but i cant install anything. already have vital info on it..need to reset password without disc and without losing info. the master password is not set and filevault is not on..just need the admin pass. or reset it .

  24. The listed procedure works great, provided you are not locked out via Firmware Protection. Is there a workaround if you are locked out by Firmware? Because I made the mistake of changing my Admin Password prior to going on holiday, only to forget what I had changed it to. Your help in restoring order would be most appreciative. Thank you

  25. The procedure works great, just like it is written. Key word being, “provided” that you are not locked out via Firmware Protection. My question is there a procedure / workaround in which I may be able to reset my admin password. If so, that would be great. Your help would be most appreciated to help retsore order. Thank you and have a nice day!!

  26. ibook m6497, mac os x, during boot up asks for username and password, don’t know either, don’t have any disks, can i get pass this?

  27. ibook m6497, mac os x, during boot up asks for username and password, don’t know either, don’t have any disks, can i get past this?

  28. ibook m6497, mac os x, during boot up asks for username and password, don’t know either, don’t have any discs, can i get past this? please help

  29. So I have tried for hours to follow the instructions above with no such luck of others! I start up and press Apple S, and the last command I get states:
    If you wish to boot the system:
    exit
    :/root#
    Someone please tell me what I am supposed to do from here? I have tried the entries from above (all), and nothing seems to help! If you can assist, please email me @:tiphoni97@yahoo.com

  30. After hours of trying, I finally got it! I am using the computer that I didnt have a password for. Although it didnt exactly happen the way stated above, the entries are correct! Thank you very much!

  31. i have the same issue as reset password without installer disk. I have tried all the commands above and have no luck. I see the same command:/root#
    I do not know the admin password and i don’t want to load programs on it until i change this. I got this mac g5 second hand.

    Can someone help, i would like to reset the whole mac if i can. Thank you so much, if you can help please email- electricpaperjam@gmail.com

  32. Hubby bought a used iBook G4 for cheap with a video problem…fixed that, then had to figure out the password for the admin. Looked up some set of directions on his own, but they were not working. I looked up these set of instructions, the ones from 12-12-07, he did what you said to do, and long story short it worked.

    If you have never messed around with linux, and need help, seek out someone who’s more technically adept than you to help you get this figured out. It’s not that hard after seeing it done, just be patient and all will be well. :)

  33. alright…everything works as described except for the part when i go to change the password. i am prompted to enter a new password which i type in (however ‘cursor’ doesn’t move, ie it doesn’t look like i’m typing) and then to confirm the new password.

    this is where i am having difficulty. i type the same thing as i did for the ‘new password’ but it does not accept it.

    any ideas?

  34. i started up the pc && entered apple and s. i got to the menu i think im supposed to see. i entered those things, but i dont think i did something right. i entered the 1st line. hit enter. ummm, what EXACTLY am i supposed to enter for the 2nd line? passwd && the name of my account? then the other stuff? i seen some people said somehting about having to enter a passwrod twice, i didnt do that. i hit reboot && the comp reboots. but every single time, nothing has changed. im a bit of a blonde, sorry. can anyone help me through this step by step? i really need my com working again.

    thanks so much

  35. same story.. got a Mac 0Sx 10.2 (i think) with no disks. Tried the steps above but screwed it up. Now when I hit command s on my keyboard I can’t get anywhere but to the regular operating system login screen..
    I’ve tried this over and over again and it won’t let me back into the backend.
    It didn’t recognize the /etc/rc the first go-round so I did the manual, which was fine, but then I forgot to do the password portion of the command and restarted before I should have.. now all the problems.
    Please email me at melaniedayle@hotmail.com

    Thanks!

  36. Used on iBook G3 800MHz, 10.2.1.

    Rebooted with Apple-S, then entered 2nd part of instructions (without hash, of course), then went from 2nd line of 1st bit – I.e. passwd etc. Good luck!

  37. worked for me after a while, when i could not get it i just entered
    passwd after the root# by its self so it looked like this and it work perfectly

    root# passwd

    then it asked me for the new password and it worked

  38. Help… I finally got it to work… I change password… re type password…. reboot… but when I login…. THE NEW PASSWORD DOESN’T WORK!

    HELP… WHAT am i doing wrong?

  39. Lost my password yesterday, this fails,
    sh /etc/rc gets a cyan screen sans root# prompt,
    passwd shortusername does not even prompt for input,
    dscl gives cryptic errors, maybe I did not properly start nibindd or whatever the netinfo or ldap database server is.

    Thanks to an article by Dave Dribin I use sha1 to replace my /var/db/shadow/hash password file and log in. I immediately download last week’s Tiger security update, reboot gets the old endless spinning wheel, not unusual after an update. After a long while the fan comes on so I forcibly power cycle by holding down the power button. It reboots ok.

    Out of curiosity I try single-user mode and to my surprise /etc/rc and passwd now work.

  40. I tried your reset advice on an ibook g3 and now it does not work at all it boots up to the control page and that is it it did not reset anything help!!
    chuck

  41. i bought a iphone from this girl that i know through a mutual friend… this was here phone and the night i bought it it was not locked but now it is… do you know a way i can get into the phone and break through the pass code.

  42. Hello,

    After numerous in single user mode I have been rendered unsuccessful in resetting my password, I am running OS X in an iBook G4 1.2 (early 2004).

    Upon logging into single user mode I am prompted by:

    Singleuser boot — fcsk not done
    Root device is mounted read-only
    If you want to make modifications to files,
    run ‘ /sbin/fsck-y’ first and then ‘ /sbin/mount -uw /’
    localhost: / root#

    After attempting to run fsck –y, I receiver a message with says:

    **/dev/rdisk0s3
    **Root file system
    **Checking HFS Plus Volume.
    Fsck_hfs: Volume is journaled. No checking performed.
    Fsck_hfs: Use the –f option to force checking.
    localhost: / root#

    I then proceed to run:

    localhost: / root# /sbin/mount –uw > teturn

    and get

    root device on (local, read-only, journaled)
    devfs on dev (local)
    localhost: / root#

    I then type in Systemmaster. But I don’t see System started but System complete.

    I have also tried:
    localhost: / root# passwd username > return (yes I am useig the short username. I did however notice when I type in ‘ls /users’ it tells me ‘Shared username username’ 2 usernames does this make a difference?)
    localhost: / root# reboot.

    The system starts up but I am still locked out?

    Please advise. Any pertinent information is greatly appreciated.
    Thanks

  43. Hello,

    After numerous in single user mode I have been rendered unsuccessful in resetting my password, I am running OS X in an iBook G4 1.2 (early 2004).

    Upon logging into single user mode I am prompted by:

    Singleuser boot — fcsk not done
    Root device is mounted read-only
    If you want to make modifications to files,
    run ‘ /sbin/fsck-y’ first and then ‘ /sbin/mount -uw /’
    localhost: / root#

    After attempting to run fsck –y, I receiver a message with says:

    **/dev/rdisk0s3
    **Root file system
    **Checking HFS Plus Volume.
    Fsck_hfs: Volume is journaled. No checking performed.
    Fsck_hfs: Use the –f option to force checking.
    localhost: / root#

    I then proceed to run:

    localhost: / root# /sbin/mount –uw > teturn

    and get

    root device on (local, read-only, journaled)
    devfs on dev (local)
    localhost: / root#

    I then type in Systemmaster. But I don’t see System started but System complete.

    I have also tried:
    localhost: / root# passwd username > return (yes I am useig the short username. I did however notice when I type in ‘ls /users’ it tells me ‘Shared username username’ 2 usernames does this make a difference?)
    localhost: / root# reboot.

    The system starts up but I am still locked out? this is exactly what i get i never get a cursor or prompt to type the new password? what gives gonna try the one suggestion of just the passwd commnand bt itselff i`ll post back my results thanx all for the info

  44. im locked out of my macbook os x with no disc. iv tried everything suggested here and still nothing.
    when i tried /sbin/mount -uw then passwd(username) it said denied and when i tried to reboot it i got an illegal warning message. if i type sh/ etc/rc it said file not found. anyone know why nothing works?

  45. i do everything you say, but i dont understand the username thing. first i typed in yourusername and it didnt work, then i typed inAlexHendershot and it showed up with some random crap. then i did it with a space and it didnt work. can you help me out here. what should my pasword be, do i set it? and why when i try to set it it appears as ‘sory’?

  46. Hi, I was just given an old imac g3 that has the old Mac OS X software 
    It is from a friend of a friend who recently passed away, from what I understood.  
    I said I would take it and use it-but there is one issue
    I can’t login at all to get into the computer.  It is set with a Password and I have tried all of those tips up here, but can’t figure out how to use them.  I have restarted with Command S and yet don’t know what to do after that- any suggestions? Thank you
    -Melissa 

    1. If you’re still looking for a solution, try this.
      There is one error in the instructions in this line: #/sbin/fsck -y
      The following worked for me with no problems.

      Hold Apple+S when booting to enter single user mode
      # /sbin/fsck -fy
      # /sbin/mount -uw /
      # passwd yourusername
      (You will be prompted to type in a new password, and yes, you will not see the characters on the screen or the curser moving. Just type in a new password and hit Return. You will be prompted to type in the new password again, and as before, you will not see the characters on the screen and the cursor will not move. Type in the new password again and hit Return.
      # reboot

      BTW, Do not type the # character before each line. It will already be on the screen. Hit Return after each line.

  47. Hi I am on ibook os x and am trying to reset it as I bought it of a friend of a friend but can’t get hold of the admin username and password! I can’t find the apple/command button can anyone help?

  48. So there is one error in the instructions in this line: #/sbin/fsck -y
    The following worked for me with no problems.

    Hold Apple+S when booting to enter single user mode
    # /sbin/fsck -fy
    # /sbin/mount -uw /
    # passwd yourusername
    (You will be prompted to type in a new password, and yes, you will not see the characters on the screen or the curser moving. Just type in a new password and hit Return. You will be prompted to type in the new password again, and as before, you will not see the characters on the screen and the cursor will not move. Type in the new password again and hit Return.
    # reboot

    BTW, Do not type the # character before each line. It will already be on the screen. Hit Return after each line.

  49. I hate being given instructions by people who act as if I should know what I’m doing already. If I knew, I would not be asking questions. NO ONE in the above comments has told any one to expect multiple lines of code and info to spring up after entering /sbin/fsck -fy. Then after that you get :/ root# on the last line. Then I do the other two lines and get even more code and info after entering the former owner’s name as it shows itself in the Accounts section for setting the password in the System Preferences. Where am I messing up?

Comments are closed.

Tagged