Recovering Passwords in Solaris 11

By paulie on Feb 11, 2013

About once a year, I'll find a way to lock myself out of a Solaris system. Here's how to get out of this scenario. You'll need a Solaris 11 Live CD or Live USB stick.

  • Boot up from the Live CD/USB92.168.
  • Select the 'Text Console' option from the GRUB menu
  • Login to the solaris console using the username/password of jack/jack
  • Switch to root
  • $ sudo su password jack
  • Mount the solaris boot environment in a temporary directory
  • # beadm mount solaris /a
  • Edit the shadow file
  • # vi /a/etc/shadow
  • Find your username and remove the password hash
  • Convert username:iEwei23SamPleHashonf0981:15746::::::17216 to username::15746::::::17216
  • Allow empty passwords at login
  • $ vi /a/etc/default/login Switch this line PASSREQ=YES to PASSREQ=NO
  • Update the boot archive
  • # bootadm update-archive -R /a
  • Reboot and remove the Live CD/USB from system
  • # reboot
  • If prompted for a password, hit return since this has now been blanked.