4 Replies Latest reply: Jan 22, 2013 3:05 PM by rccharles
nygrosity Level 1 Level 1 (0 points)

My administrator password does not work. How to I reset it?


iMac, Mac OS X (10.5.8)
  • 1. Re: Administrator password
    Kappy Level 10 Level 10 (226,760 points)

    Forgot Your Account Password

     

    For Snow Leopard and earlier

     

         Mac OS X 10.6- If you forget your administrator password

     

    For Lion/Mountain Lion

     

        Boot to the Recovery HD:

     

    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.

     

         When the menubar appears select Terminal from the Utilities menu.

         Enter resetpassword at the prompt and press RETURN. Follow

         instructions in the dialog window that will appear.

     

         Or see Reset a Mac OS X 10.7 Lion Password and

         OS X Lion- Apple ID can be used to reset your user account password.

     

    If you cannot do the above then try this:

     

      1. Boot to Safe Mode by restarting and after the chime press and hold down the COMMAND-S keys until a black screen with white type appears.

     

      2. At the prompt, type the following commands pressing return after each command line:

     

         /sbin/fsck -yf

     

         If you do not receive a "Filesystem OK" message then repeat this command until

         you do.  If after seven tries you still do not receive a "Filesystem OK" message,

         then the system is corrupted and needs to be reinstalled.

     

         mount -uw /

         cd /private/var/db/netinfo

         mv local.nidb local.old

         rm ../.AppleSetupDone

         shutdown -r now

     

    The second-to-last command above will cause OS X to think that the operating system is newly installed, and when the new owner starts up the computer it will send him/her to the startup wizard where he/she can start a new user without reinstalling.

     

    This last method does not actually change a password. It simply removes the user accounts and lets you create an initial admin account as if the computer were new out of the box.

     

    How to reset the OS X password without a startup CD:

    Reboot into Single-user Mode. Enter the following and press RETURN after each command line

     

    1. Type fsck -fy

    2. Type mount -uw /

    3. Type passwd <username>

     

    I have never tried this method myself.

  • 2. Re: Administrator password
    rccharles Level 5 Level 5 (5,360 points)

    Do not issue this command, unless you know what it does.

     

    mv local.nidb local.old

     

    This command will remove all your current accounts.  Leaving this command out lets you add a new admin account to your existing accounts.

     

    Rename is for when you account database gets messed up.

     

    Here is what I recommend for this step.

     

    ----------------------------

    Get the Mac to set up  an additional administrative account.  You can then change the password on your old account.

     

    Start with your computer power off.  Hold down command-s. Power on your computer.  

     

    Type in the following:

     

    The first two commands will depend on your release of Mac OS X.  Look at what is typed out in the console to determine the exact format.

    # Type the follow two instructions to access the startup disk in read/write. Press return after each command.

    /sbin/fsck -fy

    /sbin/mount -uw /

     

    cd /var/db

    pwd

    #List all files. The l is a lower case L.

    ls -a

    #The move command acts as a rename command in this format.

    mv -i  .applesetupdone .applesetupdone.old

     

    # reboot  your mac

    shutdown -r now

     

    Once you've done that the computer reboots and it's like the first time you used the machine. Your old accounts are all safe. From there you just change all other account passwords in the account preferences!!

    Limnos adds detailed explainations:

    http://discussions.apple.com/message.jspa?messageID=8441597#8441597

     

    The above the idea came from a post by JoseAranda at September 9, 2006 3:48 AM

    http://www.askdavetaylor.com/how_do_i_reset_my_mac_os_x_admin_root_password.html

    You will need to scroll down to see this post.  Search for applesetupdone

     

    This method is mentioned in an apple support page without giving an explanation.

     

    Once you have a new administrative account, you can change the password of your old administrative account

    blue apple > System Preferences > Accounts

  • 3. Re: Administrator password
    Kappy Level 10 Level 10 (226,760 points)

    Actually, as the command line is written it simply moves the local.nidb file to a backup file named local.old. The user can still return it to replace a new local.nidb file if needed.

     

    The outlined procedure is intended for a user with only one account, and that account is no longer usable for some reason. In fact, I think I have seen the procedure outlined elsewhere that included a warning not to use it on machines with multiple accounts.

     

    Thanks for the added information. Very useful.

  • 4. Re: Administrator password
    rccharles Level 5 Level 5 (5,360 points)

    For more info:

    http://support.apple.com/kb/HT2600?viewlocale=en_US

     

    I read it as you have to rename or delete the database then recreate it before booting!  Apple Mac OS recovers from a lot of errors.  I'd would be surprised if it recreated the net info database.

     

    mv -i  .applesetupdone .applesetupdone.old

     

    Since some people have reported a boot loop of OS X always asking for new admin account.  At least, you can rename to say initial boot as completed.

     

    --------------

     

    I'd suggest trying to get a new administrator then if that doesn't work try recreating the net info database.