1.bug描述:
通过macOS的终端terminal连接Linux服务器时,连接成功后没有操作过1-2分钟就断了
连接断掉时的提示为:
Connection to 192.168.0.23 closed by remote host.
2.解决办法
方法一:
在登录账户时设置TCPKeepAlive时间
ssh -o ServerAliveInterval=30 user@some.host.com
方法二:
在ssh配置文件中添加TCPKeepAlive设置
Host *
SendEnv LANG LC_*
TCPKeepAlive yes
ServerAliveInterval 60