SSH connectivity to VCSA is encountering issue,  connection drops after a few seconds.
search cancel

SSH connectivity to VCSA is encountering issue,  connection drops after a few seconds.

book

Article ID: 421147

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Trying to connect to vCenter server via ssh fails while the user is trying to enter the password for the root account.

Environment

vSphere 7.x, 8.x, 9.x

Cause

The default authentication timeout in SSH is 30 seconds. If the password is not entered within that time, the connection will timeout and the user will have to retry the connection.

Resolution

In certain environments the time needed to authenticate can be longer than 30 seconds (e.g. when another team handles the authentication and it requires to connect with remote team members) and/or when the password is complicated or very long and takes long time to be entered. 

In this scenarios where it is common to exceed the 30 seconds default timeout for the SSH authentication, the timeout value can be increased as follows:

1. Make a backup copy of the SSHD configuration file:

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bkp

2. Edit the configuration file and increase the default value of LoginGraceTime

vi /etc/ssh/sshd_config

Value to change: 

LoginGraceTime   30

to 

LoginGraceTime   60

(or another value as required. The above format shows the value in seconds. 30 seconds to 60 seconds, in the example above)

3. Restart the SSH service

systemctl restart sshd

4. Start a new session and validate the timeout has been increased and the connection won't drop within 30 seconds, allowing more time to complete the authentication to vCenter with username and password.