Unable to SSH to vCSA - SSH Service gets disabled immediately.
search cancel

Unable to SSH to vCSA - SSH Service gets disabled immediately.

book

Article ID: 376522

calendar_today

Updated On:

Products

VMware vCenter Server VMware vCenter Server 7.0 VMware vCenter Server 8.0

Issue/Introduction

  • Unable to SSH to vCenter Server Appliance.
  • SSH service gets disabled automatically, even if enabled from either the DCUI or VAMI page.
  • The following errors are observed in logs:

    systemd[1]: Started OpenSSH Daemon.
    sshd[8432]: /etc/ssh/sshd_config line 107: FipsMode should be set before Ciphers option
    systemd[1]: sshd.service: Main process exited, code=exited, status=255/n/a
    systemd[1]: sshd.service: Failed with result 'exit-code'.
    systemd[1]: sshd.service: Service RestartSec=100ms expired, scheduling restart.
    systemd[1]: sshd.service: Scheduled restart job, restart counter is at 4.
    systemd[1]: Stopped OpenSSH Daemon.
  • The following error appears when verifying the status of the sshd service:
    # systemctl status sshd

Environment

vCenter Server Appliance 7.x

vCenter Server Appliance 8.x

Cause

The /etc/ssh/sshd_config file is corrupt or has wrong entries.

Resolution

To resolve this issue, modify or restore the sshd_config file from a working VCSA of the same version by following these steps:

Since SSH is down on the problematic VCSA, standard SCP clients like WinSCP may fail. 

  1. Extract contents from the working VCSA:

    • Run the command cat /etc/ssh/sshd_config on the working VCSA.
    • Copy the output contents of the file and paste them into a local text editor.
  2. Prepare the problematic VCSA:

    • Access the problematic VCSA via the console (VMRC or Web Console).
    • Navigate to the directory: cd /etc/ssh/
    • Rename the existing file to create a backup by running: 
      mv sshd_config sshd_config.bak
  3. Create and populate the new configuration file:

    • Create a new file with the correct name using the vi editor: 
      vi sshd_config
      Note: Ensure the session is in the /etc/ssh/ folder when running this.
    • Press i to enter Insert mode and paste the text previously copied into the editor.
  4. Save and exit:

    • Press Esc.
    • Save and force exit the editor by typing: 
      :wq!