Search the VMware Knowledge Base (KB)
View by Article ID

"Access Denied" error when using SSH to login to the appliance (2146205)

  • 4 Ratings

Symptoms

  • Using SSH to log in to vCenter Server Appliance fails
  • You see the error:

    Access Denied
Note: For additional symptoms and log entries, see the Additional Information section.

Purpose

When logging in to vCenter Server through SSH fails with Access Denied error, set the default shell for the user to bash.

Cause

This issue occurs when the default shell for a user is set to an invalid shell.

Resolution

To confirm this issue is occurring:
  1. On the GRUB boot loader press P.
  2. Enter the root credentials when prompted.
  3. Select VMware vCenter Server Appliance and press E.
  4. Select the line that begins with kernel and press E.
  5. Add init=/bin/bash to the end of the line and press Enter. This line should start with <nousb audit=1.
  6. Press B.
  7. Run this command to see the shell settings for the users:

    cat /etc/passwd

    For example:

    ...
    polkituser:x:103:104:PolicyKit:/var/run/PolicyKit:/bin/false
    postfix:x:51:51:Postfix Daemon:/var/spool/postfix:/bin/false
    root:x:0:0:root:/root:/bin/appliancesh
    ...

  8. The root entry should be root:x:0:0:root:/root:/bin/appliancesh. If this entry does not contain /root:/bin/appliancesh review the /root/.bash_history file to see if an invalid shell was set with this command:

    less /root/.bash_history

    For example:

    #1468577177
    chsh -s "/bin/bosh" root


    Note: In the example above the root user was incorrectly set the shell to "/bin/bosh". The line above is the timestamp of this event in epoch format.

To resolve this issue, set the default shell for the user to bash:
  1. Set the default Shell to BASH by running this command:

    chsh -s /bin/bash root

  2. Restart the appliance with the command:

    reboot

Additional Information

You experience these additional symptoms:
  • You are returned to the login screen.
  • Logging in to the VAMI (https://VC_IP:5480) using same credentials is successful.
  • Using the virtual machine console to log in fails with the error:

    Invalid Shell

    Note: This error is only displayed briefly.

  • In the /var/log/messages.log file, you see entries similar to:

    2016-07-15T10:49:51.021176+00:00 vc sshd[23037]: User root not allowed because shell /bin/bosh does not exist

Tags

shell, bash, console, access denied

See Also

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 4 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 4 Ratings
Actions
KB: