What to do if you lost the root password in Solaris 9-10

solaris.gif

If you forget the root password and you cannot log into the system, you will have to do the following:

Load the Solaris cdrom (This does not have to be the same Solaris version as the machine.)

Take the machine down to the PROM level -
# init 0 (or halt)

When it comes down to the OK prompt -
OK boot cdrom -s

When it is back up -
# mount /dev/dsk/c0t0d0s0  /a (your root device/partition)
# fsck /dev/dsk/c0t0d0s0  (optional, if you can’t mount disk)
# cd /a/etc
# TERM=vt100;export TERM
# vi shadow and remove second field on root line

The root line should like -
root::12345::::::  (it must start root:: the other values are not important)

wq! (or x!)
init 6 (or reboot)

When the machine comes back up -
passwd (set a new root password)

source

Related Posts

Comments are closed.