解决linux服务器ssh链接自动超时断开问题

平时开发中使用xshell、SecureCRTPortable等工具链接服务器的时候,一段时间不操做,链接就会自动断开,须要重连,比较麻烦。下面经过修改超时时间来解决这个问题shell

第一步:修改/etc/profilebash

新增export TMOUT=1000000 (以秒为单位) 服务器

source一下,使其当即生效ssh

source /etc/profile

第二步:修改/etc/ssh/sshd_config工具

在/etc/ssh/sshd_config中加入:rest

KeepAlive yescode

ClientAliveInterval 100开发

修改完成以后重启一下sshd服务,重连便可table

service sshd restart
相关文章
相关标签/搜索