OCI: sftp or ssh Connections Failing With "ssh_exchange_identification: Connection closed by remote"
Applies To:
Oracle Cloud Infrastructure
Linux OS
Symptoms:
Intermittently unable to ssh to the server. The following error shows:
# ssh server.example.com
ssh_exchange_identification: Connection closed by remote host.
Cause:
Too many connections trying to authenticate simultaneously, surpassing the MaxStartup
value in /etc/ssh/sshd_config
.
As per sshd_config(5)
manual page:
MaxStartups
Specifies the maximum number of concurrent unauthenticated connections to the SSH
daemon. Additional connections will be dropped until authentication succeeds or the
LoginGraceTime expires for a connection. The default is 10:30:100.
Alternatively, random early drop can be enabled by specifying the three colon sepa‐
rated values start:rate:full (e.g. "10:30:60"). sshd(8) will refuse connection
0