远程连接经常断开解决
问题描述
Linux 通过远程工具 经常出现连接断开的问题;

Linux系统版本 Centos7
连接客户端 finalShell 3.9.4
解决
编辑ssh配置文件
1
sudo vim /etc/ssh/sshd_config
添加 或放开配置
1
2
3TCPKeepAlive yes
ClientAliveInterval 5
ClientAliveCountMax 180- TCPKeepAlive 保持连接
- ClientAliveInterval 客户端的心跳间隔
- ClientAliveCountMax 客户端最大的超时时间
重启服务
1
systemctl restart sshd
但是通过这种方式并没有效果;
配置环境变量中的 TMOUT
1
vim /etc/profile
写入内容
1 | export TMOUT=0 |
0 表示了不超时。
参考连接: https://blog.csdn.net/GGxiaobai/article/details/53507161
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment



