Resetting forgotten root password
The following procedure may be used to reset a forgotten root password
on a Solaris system. You will need physical or remote console access
to the system to use these steps.
If you are unable to run vi above, you can edit /etc/shadow
using the ed editor.
- Press Stop-A on the console or Ctrl-] and send
brk from a remote console connection to access the Open Boot PROM
- Insert a bootable Solaris CD/DVD and boot into single-user mode with boot
If a JumpStart boot server is located on the system's subnet, and the
system was properly configured for JumpStart, you may instead boot over
the network into single-user mode with boot net -s
- Make a mount point within the /tmp file system by typing mkdir
- Mount the root partition of your boot disk in /tmp/mnt
e.g. mount /dev/dsk/c0t0d0s0 /tmp/mnt
- Edit /etc/shadow with TERM=vt100 vi /tmp/mnt/etc/shadow
- Remove the encrypted part of the root password (the second field;
fields are separated by colons), save, and exit.
- Unmount the file system with umount /tmp/mnt
- Reboot the system and assign a new password at a shell prompt
with the passwd command.
# ed /tmp/mnt/etc/shadow
s/:.............:/::/ (Note: there are 13 dots in the second
Back to brandonhutchinson.com.
Last modified: 2007/06/05