【CentOS 7】修改SSH超时时间

1、打开/etc/ssh/sshd_config

vim /etc/ssh/sshd_config

2、搜索参数ClientAliveCountMax

:/ClientAliveCountMax

3、修改

先将该参数前面的#去掉,然后修改后面的数字,这里是设置超时最大时间,单位为分钟

这里我们设置成30分钟,如果远程用户30分钟没有操作,则自动断开远程连接


4、重启SSH服务

service sshd restart