1

I need your advise for a very important technical issue on our project. We need to have a SSH tunnel always up between our two servers. We have a MySQL database replication process going between those two servers.

We want two things:

  • When the connection is lost it automatically reconnect without our external help
  • When the computer restart the connection go automatically online

We are running under Ubuntu.

For the moment I have to manually check if the tunnel is still active. We use SSH Tunnel Manager to start the tunnel. Previously, we were using this command : ssh root@MY_SERVER.com -L 8806:localhost:3406.

Do you know a script or a software that may help us on that case? On another Windows machine we use Bitvise that can satisfy those criteria. Normally, I found Linux easier to adapt for those kind of things, but I kind of out of options this time.

Alex J.
  • 13
  • 4

1 Answers1

3

The autossh utility may do what you want

autossh is a program to start a copy of ssh and monitor it, restarting it as necessary should it die or stop passing traffic.

You should really do the job correctly and create a VPN between the two systems using openvpn (or similar).

user9517
  • 115,471
  • 20
  • 215
  • 297
  • I added this command in our crontab to solve the problem: `@reboot autossh root@MY_SERVER.com -L 8806:localhost:3406`. Thanks! – Alex J. Sep 09 '13 at 20:11