Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

autossh tunnel from sensor to server needs to be more robust #239

Closed
GoogleCodeExporter opened this issue Mar 24, 2015 · 13 comments
Closed

Comments

@GoogleCodeExporter
Copy link

Using OpenSSH's built in connection monitoring
The newer versions of OpenSSH have their own method of checking if the 
connection is still alive. You can enable this by setting the 
ServerAliveInterval and ServerAliveCountMax options (either in your ssh_config 
file or on the command line). For example
autossh -M 0 -q -f -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 
8081:localhost:80 my.linuxbox.at.home
The above command will make ssh send a keep-alive request if no other data has 
been sent for 60 seconds, if it doesn't receive a reply after 3 attempts it 
will close the connection. autossh will then detect its been closed and attempt 
re-establish it.
The "-M 0" option disables autossh's own monitoring which uses separate ports 
and is less reliable.
Note: this only works with SSH protocol version 2, which is usually enabled by 
default anyway (because version 1 has security flaws

Original issue reported on code.google.com by doug.bu...@gmail.com on 22 Mar 2012 at 2:36

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant