Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

[unix_http_server]
file=/var/run//supervisor.sock
chmod=0700

[supervisord]
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run//supervisor.sock

[include]
files = /etc/supervisor/conf.d/*.conf

The supervisor config file specifically for the autossh is:

[program:autossh]
command=autossh -M29001 -f -N -R 10033:localhost:22 name@domain.com
user=root
autostart=true
autorestart=true
stopsignal=KILL
share|improve this question
    
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
add comment

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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