Pages

Friday, October 22, 2004

Solaris: Resetting Forgotten Root Password

Need physical or remote console access to the system to use these steps:
  1. Press Stop-A on the console or Ctrl-] and send brk from a remote console connection to access the Open Boot Prompt (OBP)
  2. Insert a bootable Solaris CD and boot into single-user mode with boot cdrom -s
  3. Make a mount point within the /tmp file system by typing mkdir /tmp/mnt
  4. Mount the root partition of the boot disk in /tmp/mnt.
    ex. mount /dev/dsk/c0t0d0s0 /tmp/mnt
  5. Edit /etc/shadow with vi /tmp/mnt/etc/shadow
  6. Remove the encrypted part of the root password (the second field; fields are separated by colons), save, and exit
  7. Unmount the file system with umount /tmp/mnt
  8. Reboot the system and assign a new password at a shell prompt with the passwd command
If you are unable to run vi above, you can edit /etc/shadow using the ed editor

# ed /tmp/mnt/etc/shadow
1p
s/:.............:/::/ (Note: there are 13 dots in the second field)
1p
w
q

No comments:

Post a Comment