macOS的终端连接远程,如果超过一定时间不操作,就会被断开连接。
可以使用如下方法解决这个问题。
修改配置 /etc/ssh/ssh_config
加入
# sudo vi /etc/ssh/ssh_config
ServerAliveInterval 20
ServerAliveCountMax 20
退出所有终端,重新打开,再登录远程shell,就不会再自动退出了。
本文介绍如何在MacOS中修改ssh_config配置,避免终端长时间未操作后自动断开,通过设置ServerAliveInterval和ServerAliveCountMax来保持远程shell连接稳定。
macOS的终端连接远程,如果超过一定时间不操作,就会被断开连接。
可以使用如下方法解决这个问题。
修改配置 /etc/ssh/ssh_config
加入
# sudo vi /etc/ssh/ssh_config
ServerAliveInterval 20
ServerAliveCountMax 20
退出所有终端,重新打开,再登录远程shell,就不会再自动退出了。
1115
1797
4636
2万+

被折叠的 条评论
为什么被折叠?