SSH tunnel connections fail?

1,175 views
Skip to first unread message

Eric Muyser

unread,
Jan 12, 2011, 5:37:53 PM1/12/11
to Sequel Pro
Hi,

I have a standard, default MySQL installation in MAMP, as well as
Ubuntu, and I cannot connect via SSH. I can with SQLyog and other SQL
software. I usually just input my SSH info, use localhost, root for
username, and no password. Simple. Not with Sequel Pro though. I
checked the skip-networking param, and mine is commented out anyway.
SSH seems to be working, but it isn't connecting to 3306 successfully
(it works locally). Ideas?

Thanks. Log dump:

OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to bcsup.us.to [96.53.68.138] port 1302.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /Users/eric/.ssh/identity type -1
debug1: identity file /Users/eric/.ssh/id_rsa type -1
debug1: identity file /Users/eric/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version
OpenSSH_5.2
debug1: match: OpenSSH_5.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '[bcsup.us.to]:1302' is known and matches the RSA host
key.
debug1: Found key in /Users/eric/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-
interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/eric/.ssh/identity
debug1: Trying private key: /Users/eric/.ssh/id_rsa
debug1: Trying private key: /Users/eric/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 501
debug1: Authentication succeeded (keyboard-interactive).
debug1: Local connections to LOCALHOST:53469 forwarded to remote
address 127.0.0.1:3306
debug1: Local forwarding listening on ::1 port 53469.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 53469.
debug1: channel 1: new [port listener]
debug1: Entering interactive session.
debug1: Connection to port 53469 forwarding to 127.0.0.1 port 3306
requested.
debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug1: channel 2: free: direct-tcpip: listening port 53469 for
127.0.0.1 port 3306, connect from 127.0.0.1 port 53471, nchannels 3

Rowan Beentje

unread,
Jan 12, 2011, 6:46:13 PM1/12/11
to seque...@googlegroups.com
Hi Eric,

Interesting use of "LOCALHOST" - usually localhost triggers socket connections for MySQL, but it's evident from the debug log that the capitals result in it being correctly translated to 127.0.0.1 here!

The debug log you posted looks absolutely fine from a SSH connection point of view. In particular the following lines:

> debug1: Authentication succeeded (keyboard-interactive).
> debug1: Local connections to LOCALHOST:53469 forwarded to remote address 127.0.0.1:3306

> debug1: Connection to port 53469 forwarding to 127.0.0.1 port 3306 requested.

> channel 2: open failed: connect failed: Connection refused

So the SSH connection was established, a local port was set up as the forwarding port; then the MySQL connection was correctly attempted to the specified port. The server, however, rejected the connection to port 3306...

I think if you tried a command-line `mysql` connection attempt through a SSH tunnel, you'd see the same behaviour. What intrigues me however is that you say SQLyog and other software works fine - is that from the same IP address, using a SSH tunnel? If so they'd be doing this in exactly the same way, and would appear to be connection to port 3306 from the server you're SSHing to (normally 127.0.0.1 for the same machine, as per your log).

You also mention MAMP - are you saying connections to this also fail? Or are you using SSH connections to another machine running MAMP?

Rowan

> --
> You received this message because you are subscribed to the Google Groups "Sequel Pro" group.
> To post to this group, send email to seque...@googlegroups.com.
> To unsubscribe from this group, send email to sequel-pro+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sequel-pro?hl=en.
>

Eric Muyser

unread,
Jan 14, 2011, 3:29:26 AM1/14/11
to seque...@googlegroups.com
Hi all,

Lebannen from IRC solved it. Thanks!

[5:23pm] Lebannen: If you look in /Applications/MAMP/bin/startMysql.sh , does it specify a port there in the startup params?
[5:24pm] Lebannen: Mine does - 8889 - which would override the default 3306 in the my.cnf
[5:24pm] Lebannen: and that would cause connections to 3306 to be rejected at once
Reply all
Reply to author
Forward
0 new messages