Wednesday, February 10, 2010

Keeping an ssh Connection Alive

I had the problem where my ssh connection was being dropped after a certain amount of inactivity. It turns out you can set up a config file to counteract this and keep your ssh connections open.

Create a file and set the permissions as follows:

$ touch ~/.ssh/config
$ chmod 600 ~/.ssh/config

Then open the config file and add the line:

ServerAliveInterval 60

This will send a simple request/response signal through the connection after 60 seconds of idle time, preventing a timeout.

No comments:

Post a Comment