-   Linux - Networking (
-   -   SSH tunnel triggered by xinetd, error (

blondie72 01-19-2006 03:57 AM

SSH tunnel triggered by xinetd, error

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. :confused:

This is the xinetd configuration:

service mysql-ssh
socket_type = stream
wait = no
user = user
server = /usr/local/bin/ssh
server_args = -T -i /home/user/.ssh/id_rsa -2 -v /bin/nc 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 sleep 21m

(FC4 / Mysql 4.1.15)


All times are GMT -5. The time now is 12:29 PM.