SSH Keep Alive

Something that annoys me is when after a period of a couple of mins a firewall kills your ssh connection! Then you have a dead terminal that can take ages to timeout. So this is a solution, keeping it alive…

ssh -o TCPKeepAlive=yes user@some.host.com

Dead easy. I also have an alias in my .bashrc file in my home directory.

alias shortname=’ssh -C -o TCPKeepAlive=yes user@some.host.com’

So all have to do is type ‘shortname’ in the terminal and it would connect me to some.host.com. Much better. The big ‘C’ btw is for compression.

About phil

Complex Systems Scientist.
This entry was posted in Linux Tips. Bookmark the permalink.