17 09/2015

set ubuntu ssh timeout

最后更新: Thu Sep 17 2015 07:57:09 GMT+0800

ssh 客户端

ServerAliveInterval 100

In Linux this could be set globally in /etc/ssh/ssh_config or per-user in ~/.ssh/config. It could also be used in the command line as an argument as in the following example;

临时

ssh -o ServerAliveInterval=100 user@example.com

服务器端

/etc/ssh/sshd_config

ClientAliveInterval 600
TCPKeepAlive yes
ClientAliveCountMax 10