Tuesday, December 9, 2008

Keep ssh connections open

While in college, I've had to do a lot of work by sshing into school machines. Unfortunately, they allow a rather short "idle" time before they kick me out of whatever I was doing (littering my code folders with .swp files in the process :-P)

While one way around this is to run all your sessions in screen, it's still annoying to me to have my sessions freeze every time I go for a snack.

Fortunately, you can keep your sessions open by putting the following into ~/.ssh/config on your (client) machine:

ServerAliveInterval 60

According to the man page:
"Sets a timeout interval in seconds after which if no data has been received from the server, ssh will send a message through the encrypted channel to request a response from the server."

No comments: