If you’re like me and have a bajillion things open on your machine, it’s a real PITA to have a SSH session timing out after a couple minutes of inactivity. Maybe in certain scenarios this is beneficial, but when I’m on my personal laptop at home, it’s not a security risk.
At any rate, it’s a really simple fix and it requires the creation/editing of a local user ssh config file.
vi~/.ssh/config
Add lines:
Host * ServerAliveInterval 60
Save and Exit.
Just tweak some permissions and you’ll be good to go.
chmod 600 ~/.ssh/config
That’s pretty much it.
Details: http://www.kehlet.cx/articles/129.html