One - One Code All

Blog Content

解决iterm2终端SSH连接服务器一段时间不操作之后卡死的问题

Linux-Mac   2019-09-20 09:10:40
卡死是因为LIUNX安全设置问题,在一段时间内没有使用数据的情况下会自动断开,解决方法就是让本地或者服务器隔一段时间发送一个请求给对方即可

在本地打开配置文件(不建议在server端设置)
sudo vim /etc/ssh/ssh_config

添加以下参数,如果有直接修改
ServerAliveInterval 50 #每隔50秒就向服务器发送一个请求
ServerAliveCountMax 3  #允许超时的次数,一般都会响应

修改完之后重启一下ssh服务
sudo /etc/init.d/ssh restart




上一篇:centos卸载软件不要直接运行yum remove
下一篇:redis4.0.14编译安装

The minute you think of giving up, think of the reason why you held on so long.