Resetting root password in vSphere+ Cloud Gateway Appliance
search cancel

Resetting root password in vSphere+ Cloud Gateway Appliance


Article ID: 344976


Updated On:




This article provides steps to reset a lost, forgotten, or expired root password for a VMware Cloud Gateway Appliance.


  • The root account password of VMware Cloud Gateway Appliance fails.
  • The root account of the VMware Cloud Gateway Appliance is locked or account is expired
  • The root account password has been lost or forgotten


VMware vSphere+ Cloud Services


For passwords that have expired, the default VMware Cloud Gateway Appliance password expires after 90 days. For more information, see Change the Password and Password Expiration Settings of the Root User


Note: - VMware Cloud Gateway is a stateless appliance & doesn't support snapshot/backup.
  1. Reboot the Cloud Gateway Appliance.
  2. After the CGW Photon OS starts, press the e key to enter the GNU GRUB Edit Menu.
  3. Locate the line that begins with the word Linux.
  4. Append these entries to the end of the line:  rw init=/bin/bash
  5. The line should look like the following screenshot:

    6. Press F10 to continue booting.

    7. Run the command  
mount -o remount,rw / 
  1. In the Command prompt, enter the command passwd and provide a new root password (twice for confirmation):
  1. Unmount the filesystem by running this command (yes, the unmount command is umount  -  it's not a spelling error):
umount /
  1. Reboot the Cloud Gateway Appliance by running this command:
reboot -f
  1. Confirm that you can access the Cloud Gateway Appliance using the new root password.
  2. Remove the snapshot taken in Step 1 if applicable.
  3. You could set the Root password to never expire in order to prevent this issue by running the command:         chage -I -1 -m 0 -M 99999 -E -1 root  or at the VAMI  (https://<vcenter_fqdn>:5480)

Additionally, you can also try to login into the appliance via console/ssh.
  1. SSH into gateway appliance as root, feed in the old password. Shell forces to change the password.
  2. Enter the new password.

Additional Information

To unlock the Root account we can run below command:

# pam_tally2 --user=root --reset