Let’s have a look at this article on how to reset forgotten ESXi root password. How to use GParted Linux Live ISO to reset the forgotten root password on VMware ESXi 6.5. So you can log back into your VMware ESXi host without reinstalling. Forgotten or Lost the root password of the VMware ESXi? Is there any method to recover or reset it? Like many Linux distributions, The ESXi host also stores user account information, containing one-way encrypted credentials, in a file called /etc/shadow. You need to boot your ESXi server with a GParted Linux Live CD/DVD and you can remove the root password easily.
Table of Contents
Note: VMware doesn’t officially support this procedure. I have tested on ESXi 6.7.
I will be using a “Gparted Linux ISO live CD/DVD/ USB”, to change the ESXi root password on the VMware ESXi 6.5. Download a Gparted Live Linux ISO.
Burn the Gparted Linux Live ISO to a USB disk or a CD/DVD.
To make a bootable USB disk or CD/DVD drive with Rufus. Download Rufus
Reset Forgotten ESXi Root Password with Gparted Live?
Insert Gparted Live Media into your ESXi server and ensure the ESXi server is able to boot from a USB disk or CD/DVD. Power on your ESXi server and then choose Gparted Live (default settings).
Configuring console data, hit enter.
Press enter
Press enter again
Here you can see two partitions, the “/dev/sda5 and /dev/sda6” are what we are after supposing you installed the ESXi host on the first available hard disk/SSD.
GParted live showing the ESXi host partitions found on the primary disk
Right-click on the Gparted desktop, choose Terminals, and then lxterminal with root privileges.
1- sudo su 2- mkdir /boot /temp 3- mount /dev/sda5 /boot or mount /dev/sda6 /boot 4- cd /boot 5- cp state.tgz /temp 6- cd /temp 7- tar –xf state.tgz 8- tar –xf local.tgz 9- rm *.tgz 10- cd etc 11- vi shadow
Move the mouse cursor to the line starting with the root and then use the Delete key to delete the hash string between the root: and :13358:0:9999:7:::
After deleting the root credentials, type:wq and then hit enter.
Continue by running the following commands.
1- cd .. 2- tar –cf local.tgz etc/ 3- tar –cf state.tgz local.tgz 4- mv state.tgz /boot 5- umount /boot 6- reboot
Remove the Gparted live media
After rebooting your ESXI host. Press F2
Log on as root from the DCUI console without a password.
Here you can configure a new password.
Enter a new password and then hit enter.