This is an old revision of the document!


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>
      - now you can see the content of the file in /tmp \\ {{:vmware:esxi5:gparted-esxi-unpack.png?direct&400|}} 
      - unpack the local.tgz file: <code bash>tar xzf local.tgz


  13. change to etc dir:
    cd etc


  14. open shardow file with vi:
    vi shadow


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


  16. save file and exit (save with ESC + qw + ENTER)

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