Changing the Root Password in the Global Zone
Because the Global Zone boots into a ramdisk, it's not obvious how to make the most common change requested in that "ephemeral" environment: changing root's password.
/etc/shadow file is actually a file from the
on the persistent zpool, which is "lofs-mounted" over the file in the
/etc filesystem. That mountpoint isn't writable by
normal means (see below for details), so to change that, you'll want to
make this change:
cp /usbkey/shadow /etc/shadow
cp /etc/shadow /usbkey/shadow
This change will persist after reboots, because you've copied it back to
/usbkey/shadow location. After a reboot,
/etc/shadow will again
be an un-writable lofs mountpoint.
Alternately, you can (carefully) edit the hash in the
file with a new one. The program
/usr/lib/cryptpass will generate a
# /usr/lib/cryptpass somepassword
... this method will require a reboot to take effect.