Ubuntu下的ssh连接老是自己会断,一段时间不理它就会失去响应 如何让ssh连接服务器或者ssh tunnel保持连接呢? 其实也很方便,只要在/etc/ssh/ssh_config文件里加两个参数就行了 1 TCPKeepAlive yes 2 ServerAliveInterval 300 前一个参数是说要保持连接,后一个参数表示每过5分钟发一个数据包到服务器表示“我还活着” 如果你没有root权限,修改或者创建~/.ssh/ssh_config也是可以的