【原创】大叔经验分享(121)ssh保持连接

Windows

xshell或securecrt会自动保持连接,putty设置如下:
In your session properties, go to Connection and under Sending of null packets to keep session active, set Seconds between keepalives (0 to turn off) to e.g. 300 (5 minutes).

Linux

vim ~/.ssh/config
Host *
    ServerAliveInterval 300
    ServerAliveCountMax 2

or /etc/ssh/ssh_config

参考:https://patrickmn.com/aside/how-to-keep-alive-ssh-sessions/

原文地址:https://www.cnblogs.com/barneywill/p/13522890.html