Configuring SSH client timeouts
When a network session is transiting a firewall, the firewall may close sessions it deems idle - ones which have not sent packets for some time. At Waterloo, the default firewall configurations have a 30 minute timeout for TCP sessions - long enough for most purposes, but people with SSH sessions may find that their connection is terminated earlier than they would like. This can be fixed with a configuration change on the client side, which will cause it to send a "keepalive" packet at fixed intervals. IST recommends a 15 minute keepalive.
Windows
Using putty, edit the configuration for your session, and under Connection, change "Seconds between keepalives" to 900.
Unix/Linux/MacOS
The default SSH client for most Unix-like operating systems is OpenSSH. Versions of OpenSSH greater than 3.8 support the setting ServerAliveInterval. This can be configured globally or for individual hosts.
- Edit your personal SSH configuration file (usually $HOME/.ssh/config) and add or modify the relevant line(s).
- If you are running a version of OpenSSH older than 3.8, you should upgrade to a more recent version.
Related articles