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

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

  5. Add the text below to the end of the linux line:

    rw init=/bin/bash

  6. Press F10 to reboot the VM and enter single user mode.
  7. Type the following command to unlock and reset the root account:

    /usr/sbin/faillock --dir /var/tmp/faillock --user root --reset

  8. To change the root user's password, run the command:

    passwd

  9. When prompted, enter and confirm the new password for the appliance.
  10. 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.