In order to recover the root password, you need ubuntu Desktop operating system DVD.
1.) Halt the VMware ESXi server from the console (Hardware console whatever you have) since we can’t login to ESXi host to shutdown the server by pressing F12.
2.) Boot the server from ubuntu Desktop DVD. Here I am using ubuntu Desktop 14.04 (Latest Version) since it will work as Live CD.
3.) Once the Ubuntu is boot up , it will ask two option. You just select “Try Ubuntu”. We don’t want to install it .
4.) From the Ubuntu desktop, Click on the search icon and search for terminal .
Here you go.Double click the terminal icon.
5.) In the terminal , just gain root access by using Sudo command.Use fdisk command to list the available disks.
6.) Normally /dev/sda will be the root disk of VMware ESxi . As per the above screenshot , sda is having GPT partition and it’s not supported in fdisk .Let me try from Gparted utility.
Gparted screen will something like below one.
7.) You need to mount /dev/sda5 to recover the VMware ESXi password. You need to identify in terms of size and flag.Once you have mounted , you can see files like the below screen shot.
8.) Copy the file “state.tgz” to /tmp . Then untar the state.tgz which will create file called local.tgz.
9.) untar the local.tgz file and it will create a directory called “etc”.
10.) Go to the “etc” directory and edit the file called “shadow” using vi editor. You need to remove the strings between the first colon to the second colon.(which will be encrypted password).
11.) Here I am updating the “etc” to local.tgz and local.tgz to state.tgz. After updating the tar files , I am copying the updated state.tgz file to /mnt where we have mounted the VMware ESXi root.
12.) Unmount the /mnt and reboot it . Please make sure that you need to remove the “ubuntu Desktop” DVD from the server.So that it can boot from local hard disk.
13.) Once the VMware ESXi 5.5 boots up , just log in as root without a password.
14.) Please make sure that you are setting the new root password and store it confidentially. Do not lose it again.
We have successfully reset/recover the root password of VMware ESXi 5.5 host.
Note: VMware is not responsible if you lose something after the root password reset by following above method. I didn’t face any issue after following this method .It may differ to another environment.
Credit: http://www.unixarena.com/2014/05/recover-vmware-esxi-root-password.html