Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a field office that uses a dialup connection with a non-public IP given from the ISP.

Dialin is done by GNOME-PPP.

How can we hold an SSH connection (with tunnel) open to a server in the Internet while the computer is connected?

share|improve this question
up vote 1 down vote accepted

autossh is a tool (included in the Ubuntu repositories) which can automatically reconnect a SSH session. It can check via a separate if data is still being transmitted properly and reconnect the tunnel:

Here is a nice How-To:

This can be combined with the daemon tool, to run in background.

Complete solution:

aptitude install autossh daemon

In /usr/local/bin/autossh



autossh -M $AUTOSSH_PORT -N -L ... -R ... $USER@$HOST 

Port forwardings have to be added instead of the "...". Actually everything after -M $AUTOSSH_PORT are SSH parameters.

And at the beginning of /etc/rc.local add

daemon -n autossh /usr/local/bin/tunnel 
share|improve this answer

Your Answer


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.