LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-15-2004, 12:20 PM   #1
textomat
LQ Newbie
 
Registered: Sep 2004
Posts: 27

Rep: Reputation: 15
SSH tunnel broken


I've set up ssh tunnels to the mysql server from one machine to the other. It works fine but after a few days the connection breaks and I have to reissue the command. How can I set up a ssh tunnel to last for ever.

Here's my command which I run as root. sshtun is the user I open the tunnel as..

su - sshtun -c 'ssh -N -L 6306:localhost:3306 xx.xx.xx.xx &'
 
Old 09-15-2004, 12:26 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Try adding keepalive options to your sshd_config file. The options you use are partially dependant on your version of ssh. see that sshd_config file man page for more details.

You may also want to consider running the tunnel a service using daemontools so that it is automatically restarted if the connection does drop for any reason.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH Tunnel - need some help on this MeridianRebel Linux - Networking 2 08-11-2005 02:10 PM
ssh tunnel crep Linux - Networking 2 08-25-2004 08:24 PM
ssh tunnel TroelsSmit Linux - Software 2 04-30-2004 03:30 PM
Ssh Tunnel tinaa Linux - Software 7 07-29-2003 07:52 PM
SSH tunnel? tarballedtux Linux - Networking 3 04-09-2002 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration