Recently trying to connect via ssh using cssh to a particular server from 26 other boxes at the same time I wasn’t able to connect from some of those boxes and saw this message on those:
1 2 |
ssh_exchange_identification: Connection closed by remote host |
This was due to server configuration. Maximum default number of simultaneous connections tries (login attemps) is defined in /etc/ssh/sshd_config:
1 |
MaxStartups 10 |
We can change above value or use new-style format:
1 |
MaxStartups 10:30:60 |
Which stands for:
- 10 – number of allowed simultaneous connections attempts. Above this number SSHD will start to randomly drop connections with percentage chance of 30%
- 60 – number of simultaneous connections attempts after which SSHD will drop every new connection