在 Mac OS 上避免 SSH 超时?

每次使用 ssh 连接到服务器时,如果没有输入,几分钟后连接就会重置。但是,我希望删除这些超时,以尽可能长时间地保持连接活动。

通过查看不同的论坛,我发现可以修改/etc/ssh _ config 文件中的 ServerAliveInterval 选项。然而,在我的文件中似乎没有这个选项。会在哪儿呢?

我在雪豹上运行 OpenSSH _ 5.2 p1。

谢谢!

71506 次浏览

Server Alive interval simply sends a null packet to the server at a set time to keep the connection alive, you should just be able to add some thing like into your config file: ~/.ssh/config

Host *
ServerAliveInterval 60

The second line must be indented with at least one space. * will match any host; if you wanted you could restrict this to particular destinations like *somedomain.com.

Check out http://kehlet.cx/articles/129.html