Reset VMware vCenter Root Password
Reset VMware vCenter Root Password
You should always know the root password for your VMware vCenter. Fortunately, if you don’t remember your VMware vCenter root password, there’s a way to reset it.
In this post, I will show you step-by-step how to reset the root password for VMware vCenter.
The Process
- To be extra safe, take a snapshot of your current vCenter VM.
- Determine which ESXi host is running your vCenter VM by looking at the related objects and the host listed.
- Connect to the ESXi host that is housing the vCenter VM.
- Restart the vCenter VM.
- When you see the Photon boot screen, press the letter
e
.
- You will now see the GRUB menu.
- Edit the line that starts with the word Linux.
- At the very end of the Linux line, add
rw init=/bin/bash
That line will make Photon enter single-user mode.
- Press F10 or Ctrl-x to resume booting.
- The vCenter VM will load into single-user mode, and you will be automatically logged in as root.
- Mount the file system with read and write permissions by running the command
mount -o remount,rw /
- Remove any possible account locks for the root account.
- For vCenter versions 8.0 U2 and newer, enter the command
/usr/sbin/faillock --user root --reset
- For older versions of vCenter, run the following command instead
pam_tally2 --user=root --reset
- For vCenter versions 8.0 U2 and newer, enter the command
- Run the
passwd
command to create a new root password.
- Run the command
umount /
to unmount the file system.
- Reboot vCenter by using the command
reboot -f
- Confirm you can log in with the new root password to the vCenter Server Management interface (it used to be called the vCenter Server Appliance Management Interface (VAMI)).
- Delete the Snapshot you took earlier.
That’s all it takes to reset the root password for VMware vCenter.
If you want, you can also disable the root password expiry. My post, VMware vCenter Disable Root Password Expiry, details the process for how to do it.
If you want to read more about resting the root password for VMware vCenter, here is the VMware documentation.
Leave a comment