How recover the root password - Solaris 11?

Hello forum members,

Please help me to recover the root password. I have had difficulties working with Solaris 11.

The run-level equivalents single-user in Solaris 10, I can mount disk in one partition and edit files shadow/passwd.

For example:

{0} ok boot cdrom -s 
# mount /dev/dsk/c0t0d0s0 /a 
# cd /a/etc/ 
# vi /etc/shadow 
root ::0:::::: 

Single-user in Solaris 11, I can not mount disk. Can you help me?

{0} ok boot cdrom -s 

# mount /dev/dsk/c4t1d0s0 /a 
NOTICE: mount: not a UFS magic number (0x0) 
mount: /dev/dsk/c4t1d0s0 is not this fstype 

# mount -F zfs /dev/dsk/c4t1d0s0 /a 
cannot open '/dev/dsk/c4t1d0s0': invalid dataset name 

Thank you.
Marcela

Code tags for code please.

```text
stuff
```

or select text and hit the code button,

If you can edit the shadow files, perhaps you can set the password via passwd

Solaris 11 uses ZFS, not UFS so you can't directly mount a partition. You need import a pool instead.

Here is the ZFS way :

mkdir -p /mnt/a /mnt/b
zpool import -f -R /mnt/a rpool
zfs set mountpoint=legacy rpool/ROOT/solaris
mount -F zfs rpool/ROOT/solaris /mnt/b
vi /mnt/b/etc/shadow
...
umount /mnt/b
zfs set mountpoint=/ rpool/ROOT/solaris
zpool export rpool
init 6

Note that under Solaris 11, root is typically a role, not a regular account and blank passwords might not be accepted.

3 Likes

Thank you people :slight_smile:
Next maintenance window, I'll try to import the pool.
Sorry for not use Code tags for code. It's my first time here.
Thank you so much!