Reset Root Password on Solaris
In order to reset root password on Solaris box, you would need to do the following :
- Go to OK Prompt by:
- Once you got the OK prompt, boot into single user mode:
- Mount the root directory, On a typical system, it’s probably c0t0d0s0 or c0t0d0s1:
- Make a copy of /etc/shadow.
- Edit /etc/shadow file
- Delete the password of the root user (Leave the second field empty, dont change anything else):
- Reboot the box
- Login to root account with no password.
<stop> + <a>
or
# init 0
OK> boot cdrom -s
# mount /dev/dsk/c0t0d0s1 /
# cp /etc/shadow /etc/shadow.backupcopy
# vi /etc/shadow
Your /etc/shadow should look like this:
root:<password>::877667
root:<password>::877667
edit to
root:::877667

April 11th, 2008 at 2:41 pm
Wow. So does this mean that anyone with physical access to a Sun box would be able to reset the root password?
[Reply]
April 12th, 2008 at 12:34 am
yup .. provided they have the cd/dvd as well.. it’s not only unix even in windows if you got the physical access you can reset the administrator password
[Reply]
April 15th, 2008 at 10:20 am
I guess you’re right.
Anyway, an easy way to never forget your root password is to just set it to be “root”. Ha ha ha!
[Reply]