Alibaba Cloud Server SSH often disconnects after a while

vim /etc/ssh/sshd_config

Find the following two lines:

#ClientAliveInterval 0
#ClientAliveCountMax 3

Remove the comment and change to:

ClientAliveInterval 30
ClientAliveCountMax 1800

These two lines mean:

1. How many seconds does the client send a heartbeat data to the service
? 2. How many seconds the client does not respond, the server automatically disconnects the connection

Restart the SSHD service

service sshd restart

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324959468&siteId=291194637