We have a number of servers (currently in the 10s, soon the low 100s) deployed to varying institutions with varying network layouts. To make sure that we can access the servers at will we have them setting up reverse SSH tunnels back to a server we have in "the cloud" solely for this purpose. To keep the connections open persistently the guys who set it up used autossh and have supervisor monitoring it. The problem we're experiencing is that periodically (and somewhat frequently) the connections will just close mid-use... as in, you can be actively typing and BAM Connection to localhost closed.

If anyone could help me sort out what I'd need to change to get the connections to be more stable, I'd greatly appreciate it. If you need to see any other config files, just ask.

The main supervisor config file looks like:



supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface


files = /etc/supervisor/conf.d/*.conf

The supervisor config file specifically for the autossh is:

command=autossh -M29001 -f -N -R 10033:localhost:22 name@domain.com
  • Why haven't you looked at the logs? – Michael Hampton Sep 17 '13 at 15:12
  • 1
    This is almost certainly the wrong way to do it. A VPN as per MikeyB's suggestion is almost certainly the right way. – Tom O'Connor Sep 17 '13 at 15:33

You'll get a much more reliable setup by doing it properly with an VPN server on your central jumpbox server and having the customer machines VPN into that server and get an IP.

| improve this answer | |

I've had IDLE SSH tunnels time out regularly. To solve that, I pass -o "ServerAliveInterval=10" to ssh (which should also work with autossh). However, since you report that this can occur to an active SSH session, this may not actually fix your problem.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.