vCenter SSH root login loop or authentication failure
search cancel

vCenter SSH root login loop or authentication failure

book

Article ID: 373249

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • Unable to login to vCenter via SSH as the root user.
  • During SSH authentication, entering the root password results in an authentication loop. The system continuously resets to the password or username prompt without granting shell access or displaying an error message.
  • During vCenter upgrade 'Stage 1' - 'Connect to source appliance' fails with message "Invalid Appliance (OS) root password".

  • Root login to the VAMI (port 5480) and SSO administrator logins remain successful.
  • Reviewing /var/log/audit/sshinfo.log may show entries indicating the shell does not exist or invalid.

Environment

  • vCenter 9.x
  • vCenter 8.x
  • vCenter 7.x

Cause

The root user's default shell is mapped to an invalid path, preventing the SSH session from initializing and hence causing an authentication loop.

Resolution

  1. Login to the vCenter through SSH using the SSO administrator user name (default: [email protected]) and password.
  2. Run this command to enable access to the BASH shell:
    • shell.set --enabled true
  3. Type shell and press Enter.
  4. From the BASH shell, run the following command to correct the default shell to BASH for the root user account:
    • sudo chsh -s /bin/bash root
  5. Logout from the SSH session and verify the login to vCenter using root account.

Additional Information

  1. Reboot the vCenter Appliance.

  2. After the VCSA Photon OS starts, press the 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

    The line should look like the following screenshot:


  5. Press the F10 key to continue booting.

  6. Run the following command to remount the root filesystem with read-write permissions:
    mount -o remount,rw / 

  7. Execute the shell change command:
    chsh -s /bin/bash root

  8. Unmount the filesystem by running this command: 
    umount /

  9. Reboot the vCenter Appliance by running this command:
    reboot -f

  10. Verify access to the vCenter Appliance using the new root password.