468x60 Ads

Sunday, August 5, 2012

Pin It

Widgets

How to reset root password in Solaris server(SPARC)


Let we think our Solaris server password is lost:
There is only way to access to server again is resetting the password.
For that we have to have physical access to the server. (network access/CD or DVR Rom)
Boot the server with a Solaris CD/DVD or a net boot with a JumpStart server from the OBP OK prompt.
OK boot cdrom -s
or
OK boot net –s

This will boot the server from the DVD or Jumpstart server and launch a single user mode (No Password).
Mount the root file system (eg: /dev/dsk/c0t0d0s0 here) onto /dvd
# mount /dev/dsk/c0t0d0s0 /dvd

/dvd is a temporary mount point that is only available when you boot from DVD or a JumpStart server.
In here root file system is mounted into  /dvd. All you need to do is to edit the shadow file and remove the encrypted password for root.
Now you have to edit shadow file to remove existing root  password (password is in encrypted).
# vi /dvd/etc/shadow

root:v.ncDEpjCColQ:15498::::::
daemon:NP:6445::::::
bin:NP:6445::::::
sys:NP:6445::::::
adm:NP:6445::::::
lp:NP:6445::::::
uucp:NP:6445::::::
svctag:*LK*:6445::::::
nobody:*LK*:6445::::::
noaccess:*LK*:6445::::::
nobody4:*LK*:6445::::::
nms:WYRY9Kdk/KJvg:15383::::::
daraka:bweoCRvEGLgcQ:15555::::::

remove everything in between first “:” and second “:” ,save and quit with following command .:wq!
(now it’s looks like:  root::15498::::::)

Now, exit from the mounted file system (/dvd), unmount the root file system and reboot the system.
# cd /
# umount /dvd
# init s
Now we can login to root without password. Change password once you login.
# passwd root
New Password:
Re-enter new Password:
passwd: password successfully changed for root
# reboot
Now you can be able to logon with the new password set for root.

0 comments:

Post a Comment