Lost or forgot the root password of VMware ESXi host? Is there any recover or reset it? Just Like many Linux distributions, VMware ESXi also stores user account information, including one-way encrypted password s, in a file Called/etc/shadow. Just boot your server with a Linux Live CD and you can remove the root password easily.
This tutorial explains how to use Ubuntu Live CD to reset forgotten root password on VMware ESXi 5.5, so can log back into your ESXi server without reinstalling.
How to Reset VMware ESXi Root Password with Ubuntu Live CD?
Boot your ESXi server from Ubuntu Live CD. After a while, the system installer would appear with the option to "Try Ubuntu" or "Install Ubuntu". Click on the "Try Ubuntu" to the load Ubuntu directly into RAM, without installing it on your.
After getting to the Ubuntu desktop, click on the Ubuntu icon in the upper left corner and search forGParted in t He Dash. Double-click on GParted Partition Editor to launch it.
Look at the partition layout of ESXi 5. The actual Hypervisor/system image is located on the first MB partition (/DEV/SDA5) which contains the state.tgz file.
Now so we know that the partition which we need to mount Is/dev/sda5, close GParted and open the Terminal.
-
In Terminal, type "sudo-s" to gain root access and then mount the ESXI system partition with the following commands. After mounting, you'll see the state.tgz file, which we need to unpack now.
sudo -smount /dev/sda5 /mntcd /mntls
-
Copy State.tgz to The/tmp folder, and then unpack the State.tgz file which contains another compressed archive named LOCAL.TG Z.
cp state.tgz /tmpcd /tmptar xzf state.tgzls
-
Unpack The local.tgz file which has the/etc directory compressed in it.
tar xzf local.tgzls
Go to the/etc directory and your can gain access to the shadow file which contains the password hash of the ESXi root account.
Run the VI Shadow command to open the shadow file in the VI editor. You'll find out that the password hashes of the root account are surrounded by the first and the colons. To remove the existing root password, you need to delete the password hash.
-
Once You are removed the password hash, press ESC to return to the command mode. Type in : Wq and press Enter. This would save your changes and exit the VI editor.
-
Re-pack The files and copy the modified State.tgz file back to the ESXi system partition with the following commands:
CD&NBSP, .... tar czf local.tgz etctar czf state.tgz local.tgzcp state.tgz /mnt/umount /mnt
We ' re almost done! Just type reboot then remove the live CD and wait for ESXi server to restart. After a while, you'll get the following screen where you can configure the system by pressing F2.
Just Keep the Password field blank and you can log to the root account.
Please make sure this you set a new root password and store it confidentially. Do not lose it again.
Now you ' ve successfully reset lost root password on VMware ESXi host. The procedure is a bit complicated so carefully follow the instructions above. Enjoy it!
Reset VMware ESXi Root Password