VMware Cloud Community
vmwaredude1
Contributor
Contributor

Reset ESX server root password

I am trying to reset the root password for the ESX box. I am trying to follow the steps mentioned in the article. But still, after it boots in the troubleshooting mode, it gives me the prompt for username and password. Please tell me how can I change the root password. ( Assume that I dont have the root password)

Steps, taken by me

Power on\Reboot the ESX host and at the first menu, press 'a'.

Then at the prompt type 'single'

The ESX host will boot to a # prompt.

Type 'passwd' and enter a new password for root.

Type 'reboot'.

0 Kudos
2 Replies
esiebert7625
Immortal
Immortal

Thats the correct steps, what version of ESX are you running?

How can I reset a forgotten root password on my ESX Server?

• If you have forgotten the root password and have no way to change it rather then re-install ESX you can use the below procedure.

o Shutdown ESX and restart it at the first menu type ‘a’

o At the next prompt type ‘single’

o ESX will now go through the boot process and you will end up at a “#” prompt

o Type ‘passwd’, enter a new password for root and re-type it when prompted

o Type ‘reboot’ and you’re done

0 Kudos
Texiwill
Leadership
Leadership

Hello,

Eric's steps work UNLESS you have also password protected the boot loader as well as single user mode, which is 2 steps of a hardening recipe.

If you have done this then you will need the boot media to boot the machine into rescue mode.

Boot Media into 'text' mode ('boot text' when at boot prompt)

After you set the Mouse type 'Alt-F2'

This assumes you are using a /dev/sda device and know your filesystem layout for each partition. You should at least have this somewhere in hard copy.... This you can find by using 'vdf -h' and recording the output in hardcopy or in some good known place.

In this example:

/dev/sda2 => /

/dev/sda1 => /boot

/dev/sda3 => /var/log

mkdir /mnt/sysimage

mount /dev/sda2 /mnt/sysimage

mount /dev/sda1 /mnt/sysimage/boot

mount /dev/sda3 /mnt/sysimage/var/log

chroot /mnt/sysimage

Then the password changing commands.

before rebooting type 'exit' to exit the chroot session and then reboot or cancel the installation.

For example I use a HP and my partitions are (per vdf -h):

/dev/cciss/c0d0p6 => /

/dev/cciss/c0d0p1 => /boot

/dev/cciss/c0d0p5 => /tmp

/dev/cciss/c0d0p3 => /var

/dev/cciss/c0d0p9 => /var/log

/dev/cciss/c0d0p2 => /vmimages

So I would do the following to mount my partitions in the following order. Order is very important. / needs to be mounted first.

mount /dev/cciss/c0d0p6 /mnt/sysimage

mount /dev/cciss/c0d0p1 /mnt/sysimage/boot

mount /dev/cciss/c0d0p5 /mnt/sysimage/tmp

mount /dev/cciss/c0d0p3 /mnt/sysimage/var

mount /dev/cciss/c0d0p9 /mnt/sysimage/var/log

mount /dev/cciss/c0d0p2 /mnt/sysimage/vmimages

Best regards,

Edward

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos