Wednesday, November 5, 2014

Recover root password on Solaris 11

In my environment, recently I have faced issue with root password on one of the Solaris11 VM.
Here challenging to recover root password for this server.
These are the steps to recover root password on Solaris11 OS.

Overall activity's:
  1. In the VM guest settings, select CDROM as a Solaris11 ISO Image.
  2. Boot up from the Solaris11 ISO Image.
  3. Select the option 3 'Shell ' from the menu.
  4. Import RPOOL.
  5. Set the mount point for /root FS.
  6. Mount /root FS.
  7. Take backup of passwd and shadow files  and edit shadow file.
  8. Remove password entry for root user from shadow file.
  9. Unmount /root FS.
  10. Set /root mount point to /.
  11. Export rpool.
  12. Shutdown the server.
  13. Change boot device back to hard disk as a first boot.
  14. Power on the Solaris11 VM.
  15. From GRUB menu press "e" to boot the server in to single user mode.
  16. From the MENU select "$multiboot column" and end of the line add -s to boot the server in to single user mode and press F10 to boot the server.
  17. Enter user name "root" and for password just enter (without password).
  18. Once get the prompt and set password to root user.
  19. Reboot the server to boot into multiuser mode.
Press F2 to get the BIOS settings option

Set CDROM as a first boot device

Press F10 to save and exit

Select the option 3 "Shell" from the menu

Check availability of rpool
Import rpool

Set the mount point for /root FS

Mount /root FS

Check mount point status and take backup of password and shadow files

Check the root password entry from shadow file

Edit shadow file and remove only password entry

Make sure root password entry deleted from shadow file

Unmount /root FS 
Set /root mount point to / 
Export rpool
Shutdown the server

Change boot device back to hard disk as a first boot
Power on the Solaris11 VM
From this menu press "e" to boot the server in to single user mode

Go down and select "$multiboot column" and end of the line add -s to boot the server in to single user mode
Press F10 to boot the server

Enter user name "root" and for password just enter (without password)
once get the prompt and set password to root user
Reboot the server to boot into multiuser mode

Now we can able to login with root user




0 comments:

Post a Comment