COVID-19 Information: We are open and providing all services alongside a collect and return service, Monday and Thursday mornings. 

How to reset the OVH ESXi root password on 5.5 and 6

When you purchase an OVH dedicated server and select to install ESXi, you'll receive a temporary password. What they fail to mention is that the password you're sent expires after around 30 days. OVH is unable to reset the password and does not have a record of it. Their response is to reinstall the ESXi server and copy off any data from your ESXi hosts beforehand. Obviously, this is a very poor response from OVH and there was no way in the world we were about to perform a full reinstallation.

This guide provides information on how to reset the ESXi root password for ESXi 5.5 and ESXi 6 upwards. The procedure below will work on any ESXi installation with any provider however, you may need to tweak it slightly in regards to booting into recovery mode.

Part 1: Boot ESXi into rescue mode 

Log on to OVH and navigate to your dedicated server. Navigate to General Information: Boot and select Boot in Rescue Mode 

You'll be sent an email with instructions on how to connect to your server via SSH. We suggest using putty.
 

If you're not using OVH, boot your system from a freeBSD Linux CD or USB. If your ESXi installation is hosted in the cloud, boot into their rescue mode.


Part 2: How to reset the ESXi root password 

You should now be at the command prompt in your chosen rescue mode using putty or another SSH client. The below code represents each instruction you need to perform, one by one. 
In regards to line 2, fdisk, you're looking for a partition that is 250Mb labeled Microsoft basic data. It may be a different ID so you'll need to change the code below accordingly. If there's more than two sda's of the same size, mount both. The correct one will have the state.tgz  file in there.
 

sudo su
fdisk -l | grep /dev/sda
mkdir /mnt/sda5
mkdir /temp
mount /dev/sda5 /mnt/sda5
ls -l /mnt/sda5/state.tgz
tar -xf /mnt/sda5/state.tgz –C /temp/
tar -xf /temp/local.tgz –C /temp/
rm /temp/*.tgz
vi /temp/etc/shadow 

The first line will show root: with a string of characters.
You need to delete everything after root: and stop at the next :
You should now have something like root:876586:0:99999:7:::
You've basically removed the password. 
Save the file and exit.

Next, we're going to save the passwd file back into the tar file and put it back in it's place. 

cd /temp
tar -czf local.tgz etc
tar -czf state.tgz local.tgz
mv state.tgz /mnt/sda5/
umount /mnt/sda5
reboot (or shutdown -r now) 

Do you need IT Support?

 If you're looking fr server support, please contact us and we'll gladly assist you. 

By accepting you will be accessing a service provided by a third-party external to https://www.sysfix.co.uk/

An IT Support Company That's Happy To Help

Speak with our IT Experts today and see 
how our IT Support Services can help grow your business

 

Get in touch today