First, don't panic...
What you need to do is to bring your machine to the 'OK' prompt. So press [Stop] and [A] on your keyboard -- if one is attached -- or send break from a terminal session (normally ~# )
Next, you need to use the Solaris Installation Media CD 1 (Solaris 9) or DVD (Solaris 10) and type:
# boot cdrom -s
Now mount the root parition of the disk onto the /mnt partition by typing:
# mount /dev/dsk/c0t0d0s0 /mnt
(This assumes that /dev/dsk/c0t0d0s0 is the / partition of your server or desktop)
Remove the existing password from the shadow file by editing it in 'vi':
# vi /mnt/etc/shadow
In the example below, the root password in its encrypted format is $1$8Nr$rT.INHxDBW5gjGzi/.Simply delete it and save the file.
root:$1$8Nr$rT.INHxDBW5gjGzi/:1209:0:99999:7:-1:-1:107497043
bin:*:12188:0:99999:7:::
daemon:*:12188:0:99999:7:::
adm:*:12188:0:99999:7:::
The content of your shadow file should look like this when finished:
root::1209:0:99999:7:-1:-1:107497043
bin:*:12188:0:99999:7:::
daemon:*:12188:0:99999:7:::
adm:*:12188:0:99999:7:::
When you reboot your system, you will find that root has no password and you will be prompted for a password, so just press [enter] to continue.
Lastly, to change password from null to new password, simply type:
# passwd
Now enter the new password and you're done!
Q. I've lost the 'root' password on my machine. What should I do?
Posted by : Dr. Root | 08 November, 2006 | Published in
Subscribe to:
Post Comments (Atom)
How about when the filesystem is ZFS (under OpenSolaris)?
It real works! thanks buddie.
by the way i had to change the terminal type from "uknown" to "sun" before i opened the shadow file.
TERM=sun
export TERM
The file was read only, so I had to :wq!
Nsubis.