How delete root login password

  1. download the GParted live boot iso and create a CD or USB Stick

  2. reboot server and boot from iso

  3. the GParted window show the partitions on the server


  4. /dev/sda5 is the first esxi partition

  5. open a terminal

  6. enter following command to change on root:
    sudo -s
  7. create a subdir in the mount dir /mnt:
    mkdir /mnt/esxi
  8. mount sda5 (or maybe a other partition):
    mount /dev/sda5 /mnt/esxi
  9. find the state.tgz in mounted dir:
    ls /mnt/esxi/st*

  10. copy state.tgz to temp dir:
    cp /mnt/esxi/state.tgz /tmp
  11. change to tmp dir:
    cd /tmp
  12. unpack state.tgz:
    tar xzf state.tgz
  13. now you can see the content of the file in /tmp
  14. unpack the local.tgz file:
    tar xzf local.tgz


  15. change to etc dir:
    cd etc


  16. open shardow file with vi:
    vi shadow


  17. delete the password hash after the root account (press i, go to the : and delete all the chars until the next : )


  18. save file and exit (save with ESC + :wq + ENTER)

  19. go one dir up:
    cd ..
  20. pack the new local.tgz:
    tar czf local.tgz etc
  21. pack the new state.tgz:
    tar czf state.tgz local.tgz
  22. backup the original state.tgz:
    cp /mnt/esxi/state.tgz /mnt/esxi/state.tgz-old
  23. copy the new state.tgz:
    cp /tmp/state.tgz /mnt/esxi
  24. unmount esxi partition:
    umount /mnt/esxi

  25. 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:
  • Jochen Schnürle