Recently I came accross vCenter server in my infrastructure where root password was not working. So I thought of resetting forgotten root password. Before starting reset process make sure to take the snapshot of vcsa (VMware vCenter server appliance) virtual machine. This way it be can ensured there won't be any not mess anything on vm while doing this low level activity.
Related Article: vCenter Server SSH received disconnect Too many authentication failures
To reset root password of VCSA there is downtime required. In the downtime window reboot vCenter server. I am running latest vCenter server version 7.x, It is running on PHOTON OS Version 3.0. After reboot once the below splash screen appears, press e button on the keyboard.
On the GNU GRUB menu type rw init=/bin/bash after $systemd_cmdline. And press Ctrl-x or F10 to boot, as shown below.
GNU GRUB version 2.02~rc2 set params 'Photon' linux /$photon_linux root=$rootpartition $photon_cmdline coredump_fi\ lter=0x37 consoleblack=0 $systemd_cmdline rw init=/bin/bash if [ -f /$photon_initrd ]; then initrd /$photon_initrd fi Minimum Emacs-like screen editing is supported. TAB lists completions. Press CTRL-x or F10 to boot, Ctrl-c or F2 for a command-line or ESC to discard edits and return to the GRUB menu.
This will cause to boot vCenter server appliance into root shell, After completing boot run below commands one by one. While resetting root password make sure you are not using dictionary word for password or you may end up into failed message - passwd: Authentication token manipulation error with password unchanged.
Note: You can change the root password expiry time using command chage -I -1 -m 0 -M 99999 -E -1 root.
mount -o remount,rw / passwd umount / reboot -f
Once root password is reset successfully, you can use ssh or putty tool to connect vCenter server, if connection is successful, you can delete snapshot from VM.
If you are using vCenter version 6.7 P03 or 7 U1 and above, this is another quick way of change password of root user, if you already know it without downtime using VAMI portal. Open vCenter VAMI portal with 5480 port. Use your SSO admin or [email protected] username and password to login.
Click on the Actions on the menu, from dropdown list choose Change Root Password and SAVE it.
Useful Articles
RESOLVED : FAIL TO DEPLOY OVF TEMPLATE - TASK CANCELED BY USER
VMWare Web Client: Datastore browse files upload copy failed error
Resolved: HP ILO this page cannot be displayed ERR_SSL_BAD_RECORD_MAC_ALERT
Reset/Restart HP ILO (Integrated Lights-outs) using putty
Reset HP ILO password from Esxi server
ESXi HP Blade start issue Enclosure power event detected, System Halted until power condition is corrected
Esxi update individual component firmware on HP hardware: disk degraded not authenticated
Resolved syslog error: Call OptionManager.UpdateValues for object ha-adv-options on ESXi failed
Solved: Esxi server cannot joined into active directory domain
Solved Esxi host disconnected evaluation license expired
Connect-VIServer Error: Invalid server certificate. Use Set-PowerCLIConfiguration