解决SSH自动断线问题(Solve the problem of SSH automatic disconnection)

一、客户端定时发送心跳
1.putty、SecureCRT、XShell都有这个功能,设置请自行搜索

2.此外在Linux下:

修改本机/etc/ssh/ssh_config

vim /etc/ssh/ssh_config

添加

ServerAliveInterval 30
ServerAliveCountMax 100
即每隔30秒,向服务器发出一次心跳。若超过100次请求,都没有发送成功,则会主动断开与服务器端的连接。

————————

1、 The client sends heartbeat regularly
1. Putty, SecureCRT and xshell all have this function. Please search by yourself

2. In addition, under Linux:

修改本机/etc/ssh/ssh_config

vim /etc/ssh/ssh_config

add to

ServerAliveInterval 30
ServerAliveCountMax 100
That is, send a heartbeat to the server every 30 seconds. If more than 100 requests are not sent successfully, it will actively disconnect from the server.