For reasons known, server connections overseas Chinese mainland will be disturbed, so I use Haproxy reverse proxy it in Hong Kong.
I encountered such a problem, if the ssh connection idle for 50 seconds will automatically disconnect. I connect to the server and mainland China does not have this problem. So I think it is not Haproxy problem, I checked the configuration and Debug, did not find any problems.
Well, this question must be in the SSH, I think. I tried this configuration:
1 2 3
TCPKeepAlive yes ClientAliveInterval 40 ClientAliveCountMax 360
Then restart the SSH service, I connected again, never disconnect, and it works very well.
License CC BY-NC-SA 4.0