I discussed here about resetting the password on Sun Solaris Operating system in SPARC platform. While the procedure is almost the same wherein you boot with the CD into single user mode and mount the root partition, here we discuss the procedure to reset the password for the root user on the x86 platform.
It is recommeded that the security for the physical access to the server is restricted so as to ensure that there is no unauthorized access and anyone who follows this routine is an authorized personnel.
Boot the server with a Sun Solaris Operating System CD (I’m using a Solaris 10 CD but doesn’t matter really) or a network boot with a JumpStart server. Change the Boot order accordingly in your x86 system and start the server and launch a single user mode (No Password).
In Solaris 10, you have the default Fail Safe boot option in the Boot Loader. With this you do not need a CD or JumpStart server as selecting it will launch the Single-User shell. I haven’t used the early Solaris versions on an x86 system so if anyone knows it is availabe then please post your comments.
When you boot from the CD, select the option for the Sigle-user mode (Option 6 on Solaris 10 CD)
This will look for the currently installed Solaris OS on your system and prompts a Yes/No question to mount the Root filesystem as a Read/Write file system onto /a.
Select yes to mount the root file system (/dev/dsk/c0t0d0s0 here) on /a. If you select No, no harm as you still can mount it manually using:
solaris# mount /dev/dsk/c0t0d0s0 /a
NOTE: /a is a temporary mount point that is available when you boot from CD or a JumpStart server
Now, with the root file system mounted on /a. All you need to do is to edit the shadow file and remove the encrypted password for root.
solaris# vi /a/etc/shadow
Now, exit the mounted filesysten, unmount the root filesystem and reboot the system to single-user mode booting of the disk.
solaris# cd /
solaris# umount /a
solaris# init s
This should boot of the disk and take you to the single-user mode. Press enter at the prompt to enter a password for root.
This should allow you to login to the system. Once in, set the password and change to multi-user mode.
NOTE: Single-User mode is only to ensure that the root user without password is not exposed to others if started in multi-user mode before being set with a new password.
solaris# passwd root
This should do. You should now be able to logon as root with the new password.