Posts

Avoiding a SSH client connection to timeout

If you’re behind a firewall you sometimes run into a problem where the SSH client connection times out after a period of time (typically when going out for lunch leaving your SSH sessions logged in). The easiest way to solve this is by changing the configuration of the SSH client (it can also be fixed through the server config but since the problem often relates to the firewall protecting the client it is a better solution to fix this in the client). 

Just edit the file ./ssh/config and add the lines: 

Host *
ServerAliveInterval 30

The above assumes the firewall drops inactive connections at an interval > 30 seconds.