美文网首页
解决SSH自动断线

解决SSH自动断线

作者: 小迷糊紫靈 | 来源:发表于2019-11-29 11:01 被阅读0次

在使用Centos 系统时短时间内没有对系统进行操作ssh会自动断线。
解决方法如下:
1、找到sshd_config文件

root@localhost ~]# cd /etc/ssh/
[root@localhost ssh]# ls
moduli       ssh_host_ecdsa_key      ssh_host_ed25519_key.pub
ssh_config   ssh_host_ecdsa_key.pub  ssh_host_rsa_key
sshd_config  ssh_host_ed25519_key    ssh_host_rsa_key.pub

2、修改参数

#找到并修改
#ClientAliveInterval 0
#ClientAliveCountMax 3
 改为
ClientAliveInterval 60
ClientAliveCountMax 3 

3、重启sshd服务

systemctl restart sshd

相关文章

网友评论

      本文标题:解决SSH自动断线

      本文链接:https://www.haomeiwen.com/subject/ewvwwctx.html