编辑 /etc/ssh/sshd_config 文件
在末尾增加两行 ClientAliveInterval 30 ClientAliveCountMax 3
重启ssh服务 /etc/init.d/ssh restart