How delete root login password
download the
GParted live boot iso and create a CD or USB Stick
reboot server and boot from iso
the GParted window show the partitions on the server
/dev/sda5 is the first esxi partition
open a terminal
enter following command to change on root:
sudo -s
create a subdir in the mount dir /mnt:
mkdir /mnt/esxi
mount sda5 (or maybe a other partition):
mount /dev/sda5 /mnt/esxi
find the state.tgz in mounted dir:
ls /mnt/esxi/st*
copy state.tgz to temp dir:
cp /mnt/esxi/state.tgz /tmp
change to tmp dir:
cd /tmp
unpack state.tgz:
tar xzf state.tgz
now you can see the content of the file in /tmp
unpack the local.tgz file:
tar xzf local.tgz
change to etc dir:
cd etc
open shardow file with vi:
vi shadow
delete the password hash after the root account (press i, go to the : and delete all the chars until the next : )
save file and exit (save with ESC + :wq + ENTER)
-
pack the new local.tgz:
tar czf local.tgz etc
pack the new state.tgz:
tar czf state.tgz local.tgz
backup the original state.tgz:
cp /mnt/esxi/state.tgz /mnt/esxi/state.tgz-old
copy the new state.tgz:
cp /tmp/state.tgz /mnt/esxi
unmount esxi partition:
umount /mnt/esxi
take of CD, USB stick or unmount remote ISO and reboot server:
reboot
The ESXi should now reboot and after the boot is finished you can check the login with F2 (Settings) and login with root with empty (or without) password.
Authors: