内容简介:使用 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分钟左右才能重新连接上。
最后验证测试就可以了。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Programming Python
Mark Lutz / O'Reilly Media / 2006-8-30 / USD 59.99
Already the industry standard for Python users, "Programming Python" from O'Reilly just got even better. This third edition has been updated to reflect current best practices and the abundance of chan......一起来看看 《Programming Python》 这本书的介绍吧!