Saturday, July 15, 2017

ssh - Intermittent ssh_exchange_identification: Connection closed by remote host



We encountered an issue where a series of git requests over ssh would sometimes fail with
ssh_exchange_identification: Connection closed by remote host




There are many examples on SE/SF of structural problems (tcp-wrappers, permission on key files).



Our problem was: What is a likely cause of intermittent connection failures with this message?


Answer



Our issue appeared to have been caused by a moderately high number of incoming requests.



As soon as the number of unauthenticated connections goes over the sshd:MaxStartUps parameter,
sshd starts rejecting those connections.




The solution lies in modifying MaxStartups in sshd_config


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...