Avoid SSH connection timeout that makes terminal window freeze

While using SSH to my server from Mac OS X (via iTerm2) I didn’t have any problems, but when I connected from Ubuntu 12.04 the terminal window would just freeze after some time of not use.

The fix was as easy as adding the ServerAliveInterval in ~/.ssh/config to 4 minutes so the server would not close the connection:

Host *
  ServerAliveInterval 240


Ref: http://superuser.com/questions/98562/way-to-avoid-ssh-connection-timeout-freezing-of-terminal-tab

You might also like

Fix “Communications link failure” in Java applications with MySQL
You may have problems connecting to MySQL from Java applications using Connector/J (the Java connector...

Disable automatic locale variables setting in terminal emulator for Mac OS X
Terminal emulators usually send your current locale when conecting to an SSH server. I use Mac OS X in...

Use SSH config file to easely connect to servers via alias names
I don't have a very good memory and always have problems remembering my servers names when connecting...

Using screen to leave processes running in a terminal
If you are using an SSH connection and run a command that takes very long to process you can use nohup...

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.