Reset Root Password on Linux Virtual Appliance

I needed to login as root on a Linux based virtual appliance to do some troubleshooting. In my case the appliance was running Suse Linux Enterprise.

I booted the VA using the Ubuntu Live CD and opened a Terminal. Then I used the cfdisk tool (sudo cfdisk /dev/sda) to view the partitions:

cfdisk /dev/sda

I assumed I needed sda2 so I mounted this partition:

# sudo su
# mkdir /mnt/va
# mount /dev/sda2 /mnt/va

However if we try to change the password we get an error:

cannot open /dev/urandom for reading: No such file or directory | Cannot create salt for blowfish crtpy | Error: Password NOT changed. | passwd: Authentication token manipulation error

Apparently the /dev directory is filled while booting to make sure that it’s filled only with available devices.

To be able the change the password I mounted the /dev directory from the Ubuntu Live CD and then it works nicely:

mkdir /mnt/va | mount /dev/sda2 /mnt/va | mount --bind /dev /mnt/va/dev | chroot /mnt/va | passwd

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *