Skip to content

Instantly share code, notes, and snippets.

@rettal
Last active August 29, 2015 13:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rettal/9100759 to your computer and use it in GitHub Desktop.
sshd (the server) closes the connection if it doesn't hear anything from the client for a while.
You can tell your client to send a sign-of-life signal to the server once in a while.
The configuration for this is in the file ~/.ssh/config.
To send the signal every four minutes to remotehost, put the following in your ~/.ssh/config.
Host remotehost
HostName remotehost.com
ServerAliveInterval 240
To enable it for all hosts use:
Host *
ServerAliveInterval 240
Also make sure to run chmod 600 ~/.ssh/config, because the config file must not be world-readable.
REF: http://superuser.com/questions/98562/way-to-avoid-ssh-connection-timeout-freezing-of-terminal-tab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment