How to reset the root password for a Cloud Director Availability PhotonOS appliance
search cancel

How to reset the root password for a Cloud Director Availability PhotonOS appliance

book

Article ID: 315150

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

The purpose of this article is to detail how to reset the root password for a Cloud Director Availability appliance in case of the following scenarios:
  • The root password for the Cloud Director Availability appliance is not known by the administrator.
  • The Cloud Director Availability appliance's root password has been lost.


Environment

VMware Cloud Director Availability 4.x
VMware vCloud Availability 3.5.x
VMware vCloud Availability 3.0.x

Resolution

To reset the root password of a Cloud Director Availability appliance, perform the following steps:

Note: This procedure temporarily modifies the boot order of the VM and alters the root user's password. Ensure to take a snapshot of the Cloud Director Availability appliance before proceeding.
  1. From the vSphere Web Client, right-click on the Cloud Director Availability appliance, go to Power, and click Shut down Guest OS to stop the VM.
  2. Restart the VM and open a console window to it.
  3. On the Photon splash screen press e on the keyboard to enter GRUB edit mode.
  4. Navigate to the following line:
linux "/"$photon_linux root=$rootpartition net.ifnames=0 $photon_cmdline coredump_filter=0x37 $systemd_cmdline
  1. Add the text below to the end of the linux line:
rw init=/bin/bash
  1. Press F10 to reboot the VM and enter single user mode.

Cloud Director Availability 4.0/4.1/4.2

  1. Type the following command to unlock and reset the root account:
/sbin/pam_tally2 --user=root --reset
Note: This will display the number of failed login attempts for the root user.
  1. To confirm the root user has been reset run the following:
/sbin/pam_tally2 --user=root  
  1. To change the root user's password, run the command:
passwd
  1. When prompted, enter and confirm the new password for the appliance.
  2. Reboot the VM with the command:
reboot -f

Cloud Director Availability 4.3/4.4

  1. Type the following command to unlock and reset the root account:
/usr/sbin/faillock --dir /var/tmp/faillock --user root --reset
  1. To change the root user's password, run the command:
passwd
  1. When prompted, enter and confirm the new password for the appliance.
  2. Reboot the VM with the command:
reboot -f

Once rebooted, log in as root with the new password to verify the account is unlocked and password updated.
Now you can SSH to the VM or log into the admin UI using the new root password.