Wednesday 30 January 2013

Solaris - recover a root password in a local zone

Someone managed to reset the root password of a local zone incorrectly which resulted in a machine we couldn't log in as root......

To fix it log in to the global zone as root.

Edit the shadow file of the offending local zone (e.g. Local zone is called LZ01)

# vi /zones/LZ01/root/etc/shadow

Edit the root entry in the shadow file like so:

root::15435::::::

The save the entry (esc key, colon, wq!)

Log in to the console of the local zone from the global zone:

# zlogin -C LZ01

Log in as root (which now just logs you in without prompting for a password).

Reset the root password.

# passwd root

Follow the prompts.......

No comments:

Post a Comment