How To: Reset Admin/Root Password

How To: Reset Admin/Root Password

Anyone who has been in the IT business for any length of time knows literally hundreds of passwords. As we get older though it becomes harder and harder to remember each password and continue with safe security practices. Many companies have gone to centralized password systems. But such software is not always compatible with every OS there is. In such cases as the four year old FreeBSD server sitting in the corner that serves one application. So, here is a large list on ways to reset the root password or administrative user on many operating systems. Keep in mind that these instructions all assume you have physical access to the server in question.

FreeBSD (all versions)

  1. Turn Server off. Hitting the Power Button should start a shutdown cycle.
  2. Hit ESC when the OS starts booting
  3. Choose option 4 to boot into Single User Mode
  4. When asked for a shell, hit enter to default to /bin/sh
  5. Once the machine is booted and you see the hash, type
    1. mount -u /
    2. mount -a
  6. Type passwd to reset the password
  7. Enter new password and confirm it. “pam_chauthok(): error in service module” means that the filesystem is not mounted. Follow step 5 again.
  8. Type reboot or hit the power button again to reboot the machine normally.

Linux (Lilo Loader)

  1. Reboot machine
  2. Hit Esc to get to boot prompt if it doesn’t to it automatically
  3. type: linux single
  4. type: passwd
  5. Enter in and confirm new password
  6. type: sync
  7. type: reboot

Linux (GRUB loader)

  1. Reboot machine
  2. Hit Esc to get to boot prompt if it doesn’t to it automatically
  3. Select the Kernal. Hopefully there is only one or two and the names are descriptive. But any one SHOULD work.
  4. type: e
  5. Select the line that starts with “Kernal”
  6. type: e (again)
  7. Add the letter s (in lower case) to the very end of the line
  8. Hit Enter
  9. type the letter b to start booting
  10. Mount the drives type:
    1. mount -t proc proc /proc
    2. mount -o remount,rw /
  11. type: passwd
  12. Enter in new password and confirm it
  13. type: sync
  14. type: reboot

OS X (All Versions) OS X has two ways to reset the Administrator Password.

Option 1:

  1. Find the computer’s original boot disc. These are system specific. If it’s not available, any OS X retail boot disk will work. The wrong disc will give an error message.
  2. Boot off the disc. Accomplish by holding down the c key during power up.
  3. At the Menu go to: Utilities
  4. Choose “Reset Password”
  5. Enter in new password and confirm
  6. Click on Installer
  7. Choose Quit

Option 2:

  1. Hold Down Apple+S while booting computer
  2. Type: sh /etc/rc
  3. Type: passwd root (if that doesn’t work try admin or administrator instead of root)
  4. Enter in new password and confirm
  5. Type: reboot

Solaris (On Sun Hardware)

You must have the Solaris CDRom to do this. If you do not have physical media, get it here. Note that this download is for Ver10, so may not work on older versions.

  1. Reboot Machine
  2. Hit Stop +A to get to the OK prompt
  3. Type: boot cdrom -s
  4. Once booted off the CDRom, type: mount /dev/disk/c0t0d0s0 /a (those are Zeros)
  5. Type: vi /a/etc/shadow
  6. Use the h,j,k,l keys to move around in vi (or go here for more commands)
  7. On the second line, which says root:<bunch of random letters/numbers> type: dd
  8. Type: :wq! to save and quit out of vi
  9. Type: umount /a
  10. Type: boot ok -s (to boot into single user mode)
  11. Type: passwd
  12. Enter in new password and confirm it
  13. Type: reboot

Note that many Solaris systems may have mirrored volumes, a volume manager or other method of copying the full filesystem. If this is the case these instructions will need to be followed for both volumes, otherwise corruption can easily occur.

Solaris (i386/Intel Hardware)

Again you should have the CDRomto boot off of.

  1. Reboot Computer
  2. Enter Bios and Change Boot Order to CDRom first if needed
  3. Boot Computer
  4. On Boot Menu choose Single User mode, which is Option 6 on Solaris 10
  5. Choose Yes when asked to mount the root filesystem
    1. If you choose “No” it can still be mounted with the same command, /dev/disk/c0t0d0s0 /a (those are Zeros)
  6. Type: vi /a/etc/shadow
  7. Use the h,j,k,l keys to move around in vi (or go here for more commands)
  8. On the second line, which says root:<bunch of random letters/numbers> type: dd (to delete whole line)
  9. Type: :wq! to save and quit out of vi
  10. Typ: cd /
  11. Type: umount /a
  12. Type: init s
  13. At password prompt hit enter key
  14. Type: passwd root
  15. Enter in new password and confirm it
  16. Type: reboot

General Windows

Amazingly Windows Server does not have an easy way to recover the password. Microsoft would call this security, but do provide a package of recovery software that does the job. But it costs $199. Tech Trax has an article on reseting the password on XP system via the XP install disc. Or you can download an emergency boot cd from here, here, or buy a password cracker from here. Be extremely careful with downloading Windows password crackers from the Internet. Yes they may work, but it’s more likely they are actually a Virus or a Trojan and could cause more problems then you have already.

*edit* Hiren’s BootCD has several utilities that will allow the reseting of Windows passwords.

Windows 7
This does not reset the password, but allows you to make a new Administrative user who can then change the password in the control panel for the other user.

  1. Boot off your Windows 7 DVD
  2. Choose “Repair your computer”
  3. Go to the recovery environment
  4. Open command prompt
  5. Type “cd windowssystem32”
  6. Type “Rename Utilman.exe Utilman.exe.bak”
  7. Type Copy cmd.exe Utilman.exe
  8. Reboot Computer
  9. At Login Screen, hold down the Windows and “U” keys
  10. Type net user /add NewAccount mypassword (use your own name for NewAccount)
  11. Type net localgroup administrators NewAccount /add (replace NewAccount with the name used above
  12. Login with new user
  13. Go to Start -> Control Panel -> User Accounts and Family Safety
  14. Click on User Accounts
  15. At the bottom of “Make changes to your user account area” click “Manage another account”
  16. Choose old user
  17. Click “Change Password”
  18. Enter the new password
  19. Logout of the current account
  20. Login to the old account with the new password

Windows 8
User the Microsoft Diagnostic and Recovery Tools (download here) to reset the password.

25 thoughts on “How To: Reset Admin/Root Password

  1. lenbabyluv Reply

    I am logged in as admin on my ibook g4. Do I need to log out completely in order to reset password without the start up disc? It will not reset the password. It is not my computer nor my admin account. I am afraid to log out and try this in fear of losing access to the o.s.

  2. Rick Reply

    Nope. You do not need to log out to reset the password. If you do get logged out though, you can use option #2 under the OS X heading to reset the password.

  3. Pingback: tribe.net: www.1nova.com

  4. Marco Reply

    Hi I Have Been Working With Windows Systems For A While Now. Often I Am Asked To Recover Data From Older Computers Which Often Means Getting Around Forgotten Passwords & By Far The Easiest Way To Get Around ANY Password On XP Is To Get A Copy Of ERD Commander, There Is A Password Recovery Application That Is Simple To Use. ERD Commander Comes With A Pack Called Hiphole Superboot or Microsoft Desktop Optimization Pack (MDOP). I Have Only Just Purchaced Vista Recently & I Am Yet To Try ERD Commanders Password Recovery. I Will Post Results.

  5. dennis Reply

    I was given a MAC OS X by my mother in-law who didnt know squat about computers, and she dont remember her admin name or password. I reset the PW, but I still cant figure out her user name.How do i go about changing the name?

    • Rick Reply

      If she isn't using the admin user, but you can login as the admin user, if you go into System Preferences then Accounts (or Users) there is a list of all users available on the system. You can also create a new user there too if need be.

  6. Niks Reply

    Will I lose all the photos and document on my laptop by doing so? Thank a lot if someone can help me out.

  7. Wally Reply

    I followed your instructions for Mac OS X, but upon startup, the blue progress bar goes from start to finish, but the computer never actually starts. What's the problem?

  8. Chloe Reply

    Hi, Rick,
    I tried your method, but after putting in passwd root it comes up with
    launch_msg(): socket is not connected

    Any idea what to do now?

    P.S I just want to reset password, I need the files that I have saved there, so don't want to create a completely new admin.

    Many thanks

  9. Toz Reply

    Konboot can be used for most 32 bits OS. Systems will act as if no password were set.

  10. Gleshka Reply

    I have a big Problem!!! i can login in my account no problem with my user name and password but when i want to download programs and require my pasword again the window says u must enter ur administrator user name and password so is like no reading what im typing also to get updates… well everything requires my pasword doesnt work…. i did the keychain access reset for password and nothing happens…i checked the language and is ok … what else can i try please!! im going crazy :(((

  11. Gaurao Domle Reply

    Thanks
    Option 2: work for me

    1. Hold Down Apple+S while booting computer
    2. Type: sh /etc/rc
    3. Type: passwd root (if that doesn’t work try admin or administrator instead of root)
    4. Enter in new password and confirm
    5. Type: reboot

  12. William Reply

    Hi, I used the OS X password reset for one of my friends and followed it…

    When I typed in "sh /etc/rc" it said that the root folder didn't exist.

    What am I doing wrong?

  13. Heather Reply

    So option 2 for the mac OS X worked for me right up until I entered the new password. After I put it in, then reentered it, it just said "sorry".

  14. praveen Reply

    hi ,how to break root password in solaris 10 when root is in svm mirror

  15. Will Reply

    I tried typing sh /etc/rc and sh /etc/rc passwd root and all i got was No such file or directory and mine was a Mac Leopard.

  16. Marz Reply

    currently facing password failure on my Mac OS X Lion 10.7.5. fear of losing folder if i reset password without OS X disc. I just want to reset password, I need the files that I have saved there, so don’t want to create a completely new admin.

Leave a Reply