LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-19-2006, 03:57 AM   #1
blondie72
LQ Newbie
 
Registered: Jan 2006
Posts: 1

Rep: Reputation: 0
Question SSH tunnel triggered by xinetd, error


Hello,

I have created a SSH connection between two linux servers, that is triggered by xinetd.
Xinetd waits for a connection on port 3307, after that a tunnel is established to the target server at port 3306. Unfortunately this doesn't work with mysql. The mysql client is able to connect to 3307, but after entering the SQL password, I get this error message:

ERROR 2013 (HY000): Lost connection to MySQL server during query

The xinetd tunnel seems to work fine with other services, so its no problem sending a email (I used telnet for this), when connecting to port 25 of the target server.

This is the xinetd configuration:

service mysql-ssh
{
socket_type = stream
wait = no
user = user
server = /usr/local/bin/ssh
server_args = -T user@host.targetserver.com -i /home/user/.ssh/id_rsa -2 -v /bin/nc 127.0.0.1 3306
log_on_success += USERID
log_on_failure += USERID
disable = no
# only_from = localhost
}

There is no problem using a SSH tunnel for mysql, without using xinetd an nc.
When the tunnel is created by a cron job, there is no connection problem:

/usr/local/bin/ssh -2 -g -v -f -n -L *:3307:localhost:3306 host.targetserver.com sleep 21m

(FC4 / Mysql 4.1.15)

Greetings...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
automatically open ssh tunnel with xinetd polle007 Linux - Networking 2 07-17-2003 05:11 PM

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

All times are GMT -5. The time now is 11:29 AM.

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