segunda-feira, 14 de setembro de 2015

SSH connection timeout & freezing

For a while I was having problems when connecting to VPNs with ssh. If I forgot to make any action on the terminal, it would freeze the connection after a minute or so.

The solution I implemented is making the terminal send a signal every x seconds.

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

Make sure to run chmod 600 ~/.ssh/config, because the config file must not be world-readable.

(Took this solution from a superuser post)

1 comentário: