设置SSH 会话连接永远不超时
2020-08-08 本文已影响0人
素时年锦
更改服务器上 /etc/ssh/sshd_config
的 SSH 配置文件

- 通过命令进入:
vim /etc/ssh/sshd_config
- 去掉前面的注释
#
,然后设置时长
ClientAliveInterval 120 // 超时时间,10s
ClientAliveCountMax 720 // 超时次数,0次
- 重启下ssh服务
systemctl start sshd