20.05.2012
Main Menu
Photo Gallery
Online Profiles
* * Google AdSense * *

ESXi - Reset Root Password

Go back to Knowledge Base

It could sometimes happen that you do not know or remember the password that was set for the Root (Admin) account on your ESXi server. To reset the password, you will need to get physical access to the server, in order to boot on a CD. By using this solution, you will set a blank password for the Root account.

I found the solution in an article from http://wm-help.com and decided to share it on this website. This is always very good to share with people and write it in a second place, in order to be sure to find the information on the web when you need to access it again.

When running ESXi, it is not possible to boot using single user mode, this is why this procedure is needed.

You can use any Linux boot CD, on order to access systems file. On solution is to download Slax Linux Live CD.

In order to set a blank password, you need to follow these steps:

Operation Description
1. Linux Boot Boot on a Linux CD and launch the command line interface
2. fdisk -l List the different volumes
3. ls -l /mnt/sda5/ Find the location of state.tgz or local.tgz file.  If this file is not present on sda5, repeat the command on others volumes.
4. cd /tmp Move to tmp folder
5. cp /mnt/sda5/state.tgz state.tgz Copy the file to tmp folder
6. cp /mnt/sda5/state.tgz state.bkp Make a backup of the file in tmp folder, just in case you need to recover it later
7. gzip -d state.tgz Uncompress state.tgz
8. tar -xvf state.tar  Extract state.tar
9. gzip -d local.tgz  Uncompress local.tgz 
10. tar -xf local.tar  Extract local.tar 
11. cd etc  Move into etc folder 
12. vi shadow  Edit shadow file (i for insert, esc to exit editing mode, :wq to save and exit)
13. root::13358:0:99999:7::: Edit the first line with these information, in order to have a blank password
14. :wq Save and exit 
15.  cat shadow Verify the saved information 
16.  cd ..  Move into upper folder
17. tar -czf local.tgz etc  Create local.tgz archive
18. tar -czvf state.tgz local.tgz Create state.tgz archive
19. ls -l /mnt/sda5/ List volume content and check date & time of state.tgz file 
20. cp state.tgz /mnt/sda5/state.tgz Copy the file with blank password to the original location
21. ls -l /mnt/sda5/ List volume content and check date & time of state.tgz file, to verify you have copied the new file
22. ESXi Boot Boot on ESXi
23. Logon with Root account Logon with Root account and reset the password to what you want

 

I hope it will help you to gain access on your system when you lost your password.

Enjoy it and do not forget to provide any feedback.

Go back to Knowledge Base




* * * * * Did you like this page ? - - - Post it on your Facebook ! * * * * *
* * * * * Google Custom Search * * * * *
Last Updates
Help
Translate by Google
English French German Italian Portuguese Russian Spanish Swedish
Login Form

* * Current URL * *
Mobile Barcode
Visitors Stats
56.6%United States United States
10.8%Switzerland Switzerland
6%Canada Canada
4.8%India India
3.6%United Kingdom United Kingdom
3.6%Australia Australia
2.4%France France
2.4%Portugal Portugal
1.2%Indonesia Indonesia
1.2%Singapore Singapore

Stats by ExtraWatch