ssh login probability of failure, error: kex_exchange_identification

kex_exchange_identification: Connection closed by remote host

Log probability of failure by the host within the network or remote host ssh, landing the highest failure rate of about 80%.

Intranet win host landing performance failed on landing, landing requires repeated many times, because this host is the centralized management and control my server within the network, or can not easily adjust to reinstall the entire network have relied to a large monitor and maintain. During the attempt had to change a variety of configurations, including a variety of operating an almost post. invalid! ! !

I can only suffer in silence~

My solution is built on xshell shortcut, and then click the shortcut to the crazy landing, several months of operation and maintenance work is so DT over until ,,,, I do not want to take it anymore.
ssh login probability of failure, error: kex_exchange_identification

Try landing from another server ssh, the following error message:

[root@localhost ]# ssh -vvv [email protected]
OpenSSH_8.1p1, OpenSSL 1.0.2p 14 Aug 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolve_canonicalize: hostname 192.168.XX.XX is address
debug2: ssh_connect_direct
debug1: Connecting to 192.168.XX.XX [192.168.XX.XX] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: identity file /root/.ssh/id_xmss type -1
debug1: identity file /root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
kex_exchange_identification: Connection closed by remote host

Baidu given the information to no avail, all this error message ssh_exchange_identification: Connection Closed by Remote Host , no I'm looking for KEX , no choice but to try to change the parallel landing parameters and maximum number of connections.

MaxSessions: maximum allowable number of links, the default 10.

MaxStartups: to maintain the maximum allowable number of unauthenticated link (do not enter a login password), default value is 10.

#MaxStartups 10: 30: Specifies the maximum number of 100 original configuration SSH daemon unauthenticated concurrent connections, the default value is 10: 30: 100.10: 30: 100 represents the meaning, starting from the first 10 connections, 30% probability (incremental) refuse new connections, guide number of connections reached 100.

The MaxStartups sshd configuration limits the number of concurrent client can authenticate to 10, do not ask me why know, to see the cat / etc / ssh / sshd_config on your landing | grep MaxStartups know.

Ssh connections can be viewed
netstat -nat | grep -i '22' | wc -l or lsof -i: 22 | wc -l

I will
MaxSessions into 2000
MaxStartups also changed to 2000

Then restart sshd service
world finally have peace now.
The original disaster are concurrent connections mess.

Guess you like

Origin blog.51cto.com/86net/2452445