美文网首页
修改sftp服务默认提供者sshd的session timeou

修改sftp服务默认提供者sshd的session timeou

作者: 蟠龙有悔 | 来源:发表于2018-07-04 12:37 被阅读0次

ssh连接超时问题解决方案:
1.修改server端的etc/ssh/sshd_config

ClientAliveInterval 60 #server每隔60秒发送一次请求给client,然后client响应,从而保持连接
ClientAliveCountMax 3 #server发出请求后,客户端没有响应得次数达到3,就自动断开连接,正常情况下,client不会不响应

2.修改client端的etc/ssh/ssh_config添加以下:(在没有权限改server配置的情形下)

ServerAliveInterval 60 #client每隔60秒发送一次请求给server,然后server响应,从而保持连接
ServerAliveCountMax 3  #client发出请求后,服务器端没有响应得次数达到3,就自动断开连接,正常情况下,server不会不响应

3.使用ssh命令设置保持连接的方式:

[root@VM_0_4_centos ~]# ssh -o ServerAliveInterval=60 //这样子只会在需要的连接中保持持久连接, 毕竟不是所有连接都要保持持久的

重新启动sshd

[root@VM_0_4_centos ~]# systemctl restart sshd

摘录自:https://www.cnblogs.com/niutouzdq/p/4091268.html

相关文章

网友评论

      本文标题:修改sftp服务默认提供者sshd的session timeou

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