Unable to establish an SSH connection to the vCenter Server.
search cancel

Unable to establish an SSH connection to the vCenter Server.

book

Article ID: 319426

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When attempting to access the vCenter Server via SSH using either the root account or a local SSO user, the following error is encountered:

Type: vCenter Server with an embedded Platform Services Controller
/etc/profile.d/proxy.sh: line 11: Enable: command not found
Traceback (most recent call last):
File "/usr/lib/applmgmt/base/bin/vherdrunner", line 8, in <module>
vherdrunner.start(vherdrunner.directories)
File "/usr/lib/applmgmt/base/bin/vherdrunner.py", line 118, in start
exec(code, childGlobals)
File "/usr/lib/applmgmt/linux_cli/bin/main-shell", line 11, in <module>
sys.exit(cli.main(sys.argv, products=('vherd', 'appliance')))
File "/usr/lib/applmgmt/linux_cli/py/vmware/vherd/linux_cli/cli.py", line 1470, in main
cookieOnly=parsedArgs.get_cookie)
File "/usr/lib/applmgmt/linux_cli/py/vmware/vherd/linux_cli/cli.py", line 289, in connect
self.config['mode'])
File "/usr/lib/applmgmt/linux_cli/py/vmware/vherd/linux_cli/introspection_parser.py", line 153, in findMethod
methodList = self.server.system.listMethods()
File "/usr/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
return self.__send(self.__name, args)

 

Environment

vCenter Server 7.0.x

vCenter Server 8.0.x

Cause

There are extra or incorrect characters/lines in the /etc/sysconfig/proxy file on the vCenter Server.

The issue is caused by the configuration in /etc/sysconfig/proxy not meeting the requirements outlined in the following article: Proxy Settings for vCenter Server

Resolution

  • The following steps outline how to edit the /etc/sysconfig/proxy file:

    1.  Boot into emergency mode of the vCenter:
      • Identify the host where the vCenter VM resides.

      • Reboot the vCenter VM and immediately after the OS starts, press e to open the GNU GRUB Edit Menu.

      • Locate the line that begins with the word linux.

      • Append this to the end of that line to boot the OS into emergency mode:

        systemd.unit=emergency.target

    2. Once the OS has booted enter the following command to mount the root directory:
      mount -o remount,rw /

    3. Now it is needed to modify the vCenter -/etc/sysconfig/proxy file.
      • Change the directory to the proxy file
        cd /etc/sysconfig

      • Backup the proxy file:
        cp proxy proxy.bak

      • Remove the misconfigured characters/line of the file and save the file by running
        :wq!

    4. Unmount the root directory:

      umount /

    5. Reboot the appliance:

      reboot -f

    6.  Access the vCenter using SSH

Additional Information

If you need to restore to the original file:

cp proxy.bak proxy

Sample:

# Enable a generation of the proxy settings to the profile.
# This setting allows to turn the proxy on and off while
# preserving the particular proxy setup.
#
PROXY_ENABLED="no"

# Some programs (e.g. wget) support proxies, if set in
# the environment.
# Example: HTTP_PROXY="http://proxy.provider.de:3128/"
HTTP_PROXY=""

# Example: HTTPS_PROXY="https://proxy.provider.de:3128/"
HTTPS_PROXY=""

# Example: FTP_PROXY="http://proxy.provider.de:3128/"
FTP_PROXY=""

# Example: GOPHER_PROXY="http://proxy.provider.de:3128/"
GOPHER_PROXY=""

# Example: SOCKS_PROXY="socks://proxy.example.com:8080"
SOCKS_PROXY=""

# Example: SOCKS5_SERVER="office-proxy.example.com:8881"
SOCKS5_SERVER=""

# Example: NO_PROXY="www.me.de, do.main, localhost"
NO_PROXY="localhost, 127.0.0.1"