Set ssh keep-alive
by
Akaname
—
last modified
Jul 29, 2011 11:10 PM
This will setup your ssh client for automatic tcp keep-alive. However, keep-alive interval and timeout of the tcp connection can not be set up easily, because they are specified by the operating system.
ssh -o TCPKeepAlive=yes user@foo.com
A more flexible and reliable way is:
ssh -o ServerAliveInterval=120 user@foo.com
Which means, the ssh client sends a keep-alive message every 120 seconds.
See man ssh.
