Reset Solaris 11 root password x86 sparc

por | 13 septiembre, 2016

setenv network-boot-arguments host-ip=192.168.1.225,router-ip=192.168.1.1,subnet-mask=255.255.255.0,file=http://192.168.1.213:5555/cgi-bin/wanboot-cgi

boot net -s failsafe

root/solaris (default password)
As you can see in the configuration file root is a role

Assign the root role to your local account.

# usermod -R root jdoe-local

[email protected]:~# cat /etc/user_attr
#
# The system provided entries are stored in different files
# under "/etc/user_attr.d". They should not be copied to this file.
#
# Only local changes should be stored in this file.
# This line should be kept in this file or it will be overwritten.
#
root::::type=role
melam::::type=normal;lock_after_retries=no;profiles=System Administrator;roles=root

To change it

root[email protected]:~# rolemod -K type=normal root

 

bring the system to OK prompt(Sparc) or BIOS (x86) and boot from cdrom

to accomplish this :

– For sparc ,type at OK prompt(  boot cdrom -s) and login with username/password   : root/solaris

– For x86 Servers: boot from Solaris CD,select  desired “Keyboard” and ” Keyboard Layout” or use default ones, once you reach the “Solaris Installation  menu” , ( select option 3, which is Shell)

you should get now command prompt (x86 or Sparc).

Mostly the pool name for root file system is (rpool),to be sure what pool name is we issue this command:
# zpool import |grep -i pool:
pool:rpool
pool:repo

so ,we have two pools ,and the one we need is (rpool),so force importing this pool by:
# zpool  import -f rpool   (to import root pool)

#beadm list

beadm-list

As seen we have one be (boot environment) named solaris

# beadm mount solaris /a   

# vi /a/etc/shadow
make root line to be like (root::123212::::::5) [clear all text between first (:) end second (:),this text is the encrypted password for root]

By default, Solaris doesn’t allow empty password ,the workaround is to disable an option in file (/a/etc/default/login)

# vi /a/etc/default/login

search for (PASSREQ=yes) and change to (PASSREQ=no).

Now, Update bootenvironment by the following command

bootadm update-archive -R /a

– for Sparc servers , issue command  (init 0) , and at OK prompt ( OK  boot)

– for x86 servers:issue command (reboot ), and boot from harddisk

enter login-name as root, the shell will drop you directly to shell without asking fro password.

edit the file (/etc/default/login), change (PASSREQ=no) to (PASSREQ=yes).

set your root password by typing command (passwd) without any option.

Reference: https://blogs.oracle.com/paulie/entry/recovering_password_on_solaris_11