SSH connection keeps dropping

I’ve got a shitty internet connection at the moment. While I’m surfing I can barely notice, but the connection itself keeps dropping. As a result, all my SSH connections drop as well.

Here’s the little trick I’me using:

1
ssh -o ServerAliveInterval=30 user@host.com

This will force a “I’m alive” signal every 30 seconds – it is enough to keep me connected!

Additionally, if you want ALL ssh connections to have this option you can edit the ~/.ssh/config file:

1
2
Host *
ServerAliveInterval 30

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>