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)
- Turn Server off. Hitting the Power Button should start a shutdown cycle.
- Hit ESC when the OS starts booting
- Choose option 4 to boot into Single User Mode
- When asked for a shell, hit enter to default to /bin/sh
- Once the machine is booted and you see the hash, type
- mount -u /
- mount -a
- Type passwd to reset the password
- Enter new password and confirm it. “pam_chauthok(): error in service module” means that the filesystem is not mounted. Follow step 5 again.
- Type reboot or hit the power button again to reboot the machine normally.
Linux (Lilo Loader)
- Reboot machine
- Hit Esc to get to boot prompt if it doesn’t to it automatically
- type: linux single
- type: passwd
- Enter in and confirm new password
- type: sync
- type: reboot
Linux (GRUB loader)
- Reboot machine
- Hit Esc to get to boot prompt if it doesn’t to it automatically
- Select the Kernal. Hopefully there is only one or two and the names are descriptive. But any one SHOULD work.
- type: e
- Select the line that starts with “Kernal”
- type: e (again)
- Add the letter s (in lower case) to the very end of the line
- Hit Enter
- type the letter b to start booting
- Mount the drives type:
mount -t proc proc /proc
mount -o remount,rw /
- type: passwd
- Enter in new password and confirm it
- type: sync
- type: reboot
OS X (All Versions) OS X has two ways to reset the Administrator Password.
Option 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.
- Boot off the disc. Accomplish by holding down the c key during power up.
- At the Menu go to: Utilities
- Choose “Reset Password”
- Enter in new password and confirm
- Click on Installer
- Choose Quit
Option 2:
- Hold Down Apple+S while booting computer
- Type: sh /etc/rc
- Type: passwd root (if that doesn’t work try admin or administrator instead of root)
- Enter in new password and confirm
- 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.
- Reboot Machine
- Hit Stop +A to get to the OK prompt
- Type: boot cdrom -s
- Once booted off the CDRom, type: mount /dev/disk/c0t0d0s0 /a (those are Zeros)
- Type: vi /a/etc/shadow
- Use the h,j,k,l keys to move around in vi (or go here for more commands)
- On the second line, which says root:<bunch of random letters/numbers> type: dd
- Type: :wq! to save and quit out of vi
- Type: umount /a
- Type: boot ok -s (to boot into single user mode)
- Type: passwd
- Enter in new password and confirm it
- 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.
- Reboot Computer
- Enter Bios and Change Boot Order to CDRom first if needed
- Boot Computer
- On Boot Menu choose Single User mode, which is Option 6 on Solaris 10
- Choose Yes when asked to mount the root filesystem
- If you choose “No” it can still be mounted with the same command, /dev/disk/c0t0d0s0 /a (those are Zeros)
- Type: vi /a/etc/shadow
- Use the h,j,k,l keys to move around in vi (or go here for more commands)
- On the second line, which says root:<bunch of random letters/numbers> type: dd (to delete whole line)
- Type: :wq! to save and quit out of vi
- Typ: cd /
- Type: umount /a
- Type: init s
- At password prompt hit enter key
- Type: passwd root
- Enter in new password and confirm it
- 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.
- Boot off your Windows 7 DVD
- Choose “Repair your computer”
- Go to the recovery environment
- Open command prompt
- Type “cd windowssystem32”
- Type “Rename Utilman.exe Utilman.exe.bak”
- Type Copy cmd.exe Utilman.exe
- Reboot Computer
- At Login Screen, hold down the Windows and “U” keys
- Type net user /add NewAccount mypassword (use your own name for NewAccount)
- Type net localgroup administrators NewAccount /add (replace NewAccount with the name used above
- Login with new user
- Go to Start -> Control Panel -> User Accounts and Family Safety
- Click on User Accounts
- At the bottom of “Make changes to your user account area” click “Manage another account”
- Choose old user
- Click “Change Password”
- Enter the new password
- Logout of the current account
- Login to the old account with the new password
Windows 8
User the Microsoft Diagnostic and Recovery Tools (download here) to reset the password.