How to avoid SSH unexpected disconnecion occupying the server's startup limit?

21 views Asked by At

When I'm connecting the server with SSH, the server sometimes throws this error

$ ssh myHost
kex_exchange_identification: read: Connection reset by peer
Connection reset by [Server IP Address] port 22

It seems that the problem was more frequent when using VS Code.

I've searched for help and some of the answer said it's because of the limit of "MaxStartup". So I tried this:

$ netstat -anp | grep [My IP Address]
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0    164 [Server IP Address]:22        [My IP Address]:51682     ESTABLISHED -
tcp        0    *** [Server IP Address]:22        [My IP Address]:*****     ESTABLISHED -
tcp        0    *** [Server IP Address]:22        [My IP Address]:*****     ESTABLISHED -
...

There're many connections from my IP, but only one of them is exactly connected, the others are all "died".And some of the answer said that this may because of unexpected disconnection.

So if this is exactly the problem. How can I avoid the unexpected disconnection making a SSH session "died", but not killed?

0

There are 0 answers