解决Mac下SSH闲时自动断开的问题

栏目: 服务器 · 发布时间: 6年前

内容简介:使用 Mac 自带终端 SSH 连接服务器时,只要隔一小段时间不进行操作的话连接就会自动中断,造成了不好的体验。解决方法如下:1、连接到你的服务器2、编辑服务端配置文件 /etc/ssh/sshd_config

使用 Mac 自带终端 SSH 连接服务器时,只要隔一小段时间不进行操作的话连接就会自动中断,造成了不好的体验。解决方法如下:

1、连接到你的服务器

2、编辑服务端配置文件 /etc/ssh/sshd_config

vim /etc/ssh/sshd_config

添加以下两行配置代码

ClientAliveInterval 30
ClientAliveCountMax 3

3、编辑客户端配置文件 /etc/ssh/ssh_config

vim /etc/ssh/ssh_config

在 Host * 下面添加以下两行配置代码

ServerAliveInterval 30
ServerAliveCountMax 3

4、断开SSH连接

Ctrl + d

5、SSH 重连服务然后执行重启

sync 将数据由内存同步到硬盘中。
reboot 就是重启

重启后可能需要等待1分钟左右才能重新连接上。

最后验证测试就可以了。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Modeling the Internet and the Web

Modeling the Internet and the Web

Pierre Baldi、Paolo Frasconi、Padhraic Smyth / Wiley / 2003-7-7 / USD 115.00

Modeling the Internet and the Web covers the most important aspects of modeling the Web using a modern mathematical and probabilistic treatment. It focuses on the information and application layers, a......一起来看看 《Modeling the Internet and the Web》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具