top of page
Writer's pictureHanh Nguyen

UNIX – RESET ROOT PASSWORD

1.1              How To: Reset Admin/Root Password

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

  6. mount -u /

  7. mount -a

  8. Type passwd to reset the password

  9. Enter new password and confirm it. “pam_chauthok(): error in service module” means that the filesystem is not mounted. Follow step 5 again.

  10. 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:

  11. mount -t proc proc /proc

  12. mount -o remount,rw /

  13. type: passwd

  14. Enter in new password and confirm it

  15. type: sync

  16. 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). User Sun Keyboard then press Stop +a to go to ok prompt

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

  6. If you choose “No” it can still be mounted with the same command, /dev/disk/c0t0d0s0 /a (those are Zeros)

  7. Type: vi /a/etc/shadow

  8. Use the h,j,k,l keys to move around in vi (or go here for more commands)

  9. On the second line, which says root:<bunch of random letters/numbers> type: dd (to delete whole line)

  10. Type: :wq! to save and quit out of vi

  11. Typ: cd /

  12. Type: umount /a

  13. Type: init s

  14. At password prompt hit enter key

  15. Type: passwd root

  16. Enter in new password and confirm it

  17. Type: reboot

0 views0 comments

Recent Posts

See All

LDOM BASIC

1)How to Enable the Logical Domains Manager Daemon # svcadm enable ldmd # /opt/SUNWldm/bin/ldm list 2)Upgrading a System That Is Already...

Change hostname in Solaris 11

Change homename to dev svccfg -s system/identity:node setprop config/nodename=”dev” svccfg -s system/identity:node setprop...

Comments


bottom of page