ssh 无操作自动断开设置

#法二 客户端配置 ssh_config

TCPKeepAlive yes
ServerAliveInterval 30
ServerAliveCountMax 86400


#法一 服务端配置 sshd_config

TCPKeepAlive yes

ClientAliveInterval 30

ClientAliveCountMax 86400

 

重启服务

centos: /bin/systemctl restart  sshd.service

ubuntu: sudo /etc/init.d/ssh restart

你可能感兴趣的:(Ubuntu)