服務器端設定:
/etc/ssh/sshd_config
ClientAliveInterval 60 //每60秒向客戶端發送一次信號
ClientAliveCountMax 2 //重試鏈接次數
客戶端進行設置也能夠實現
/etc/ssh/ssh_config文件里加兩個參數就好了
1 TCPKeepAlive yes
2 ServerAliveInterval 300
鏈接時增長參數
ssh -o TCPKeepAlive=yes -o ServerAliveInterval=300 Server....服務器