LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   SSH tunnel triggered by xinetd, error (https://www.linuxquestions.org/questions/linux-networking-3/ssh-tunnel-triggered-by-xinetd-error-405307/)

blondie72 01-19-2006 03:57 AM

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

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


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