root password hack on Solaris.

0. Load the Solaris CD/DVD.

1. Take the machine down to the PROM level:
# init 0 (or halt)

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

3. 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 this:
root::12345:::::: (it must start root:: the other values are not important)
wq! (or x!)
init 6 (or reboot)

4. When the machine comes back up:
passwd (set a new root password)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s