HyperSmash

Sunday 9 December 2012

Oracle Solaris 10 : Reset root password using fail-safe mode.

If you encountered the issues forgotten the root password. Below are the solution for the issues.

Notes :
This step has been applied and tested on SPARC T-Series machine.

1. On Solaris OK prompt, run syntax : "boot -F failsafe". The system will boot up into Solaris fail-safe mode.

2. Once in fail-safe mode, mount the root disk into /a. Run syntax : "mount <root-disk> /a"

3. After that, perform file system checking to ensure no file system issues before editing the related password file. This step also to avoid you facing up password file corruption. Run syntax : "fsck -y <root-disk>".

4. Once done, perform backup on related password files. Run syntax : "cp /a/etc/passwd /a/etc/passwd.bk" and "cp /a/etc/shadow /a/etc/shadow.bk"

5. After that, verify each of line on the file. This  to ensure the both of password files indicate the same line. Run syntax: "cat /a/etc/passwd | wc -l" and "cat /a/etc/shadow  | wc -l".

6. Before editing the shadow file. Load the terminal shell mode to run vi editor as usual.
#TERM=vt100
#export TERM

7. Once done, edit the shadow file, run syntax "vi /a/etc/shadow" and delete the encrypted password in root user line.

8. Once finished, boot the machine into single user mode and set the root password back as usual.