ssh idle keepalive timeouts

I’v had to solve this problem a few times and thought that I would post it up here. The problem is basically that when ssh’ing into a machine in a remote location, sometimes your session will log off because a firewall or something in between is ending the connection.

The simple solution is to find the keepalive packet option and enable it on your ssh client.

On Windows using Putty:
I found the following configurations in the “Connection” section:
Seconds between keepalives (0 to turn off)
Enable TCP keepalives
Try setting it to 180 seconds and enabling the TCP keepalives.

Edit the /etc/ssh/ssh_config:
ServerAliveInterval 180

linux probably works the same as the OSX, but I’ve never actually ran into the problem on any of my connections.

This entry was posted in software, tips and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *