Cannot connect using SSH (SQLWorkBench or DataGrid works) #2634

Open
sarsonj opened this Issue Dec 19, 2016 · 9 comments

Projects

None yet

3 participants

@sarsonj
sarsonj commented Dec 19, 2016

Hi,

I just reinstalled my Mac and since then, I am not able to connect to mysql using SSH in Sequel Pro. The same method works on the same machine in SQLWorkbench or Jetbrains DataGrid, so that it is not problem with server settings.

I always get Connection failed error.

screen shot 2016-12-19 at 15 17 00

Any idea where could be problem? I am login using private key.

screen shot 2016-12-19 at 15 17 42

@RichiWIP
RichiWIP commented Jan 2, 2017

I have the same problem since I upgraded to Sierra. I have noticed that, when using ssh in the terminal, I have to always enter the passphrase for the key. This was not the case before.
If I copy the command that is used from the details screen and execute it in the terminal, I get a password prompt and then it works.

@dmoagx
Collaborator
dmoagx commented Jan 2, 2017 edited

@sarsonj When the error message is displayed, open Terminal and execute ps aux | grep ssh to see the SSH command Sequel Pro executes.
Copy the command, replace the -v with -vvvv and manually run the command in Terminal, then post the output (note: this may contain sensitive data)

@RichiWIP In your case it sounds like Sequel Pro cannot even bring up an SSH tunnel, so please post the output from the Details dialog.

Also DataGrip, being an IntelliJ IDE, most likely uses JSch, while Sequel Pro uses the native OS X SSH client.

@RichiWIP
RichiWIP commented Jan 2, 2017

Thanks for the quick reply. Here is the output:

Used command:  /usr/bin/ssh -v -N -S none -o ControlMaster=no -o ExitOnForwardFailure=yes -o ConnectTimeout=10 -o NumberOfPasswordPrompts=3 -o TCPKeepAlive=no -o ServerAliveInterval=60 -o ServerAliveCountMax=1 richiwip@x.x.x.x -L 62363:10.0.21.20:3306

OpenSSH_7.3p1, LibreSSL 2.4.1
debug1: Reading configuration data /Users/richiwip/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Control socket " none" does not exist
debug1: Connecting to x.x.x.x [x.x.x.x] port 22.
debug1: fd 4 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /Users/richiwip/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u3
debug1: match: OpenSSH_6.7p1 Debian-5+deb8u3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to x.x.x.x:22 as 'richiwip'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:iD4KdJaTABBPcEgEUXm3xZx2/MUJb7dXAcuQjVWr2bk
debug1: Host 'x.x.x.x' is known and matches the ECDSA host key.
debug1: Found key in /Users/richiwip/.ssh/known_hosts:89
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/richiwip/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/richiwip/.ssh/id_dsa
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 503
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 503
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 503
debug1: Trying private key: /Users/richiwip/.ssh/id_ecdsa
debug1: Trying private key: /Users/richiwip/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
@dmoagx
Collaborator
dmoagx commented Jan 2, 2017 edited

Do you have anything configured in ~/.ssh/config?
Also please try this #2619 (comment) and post the resulting file.

@RichiWIP
RichiWIP commented Jan 3, 2017

Here is the output when I try that:

################################################################
# Benutzerdefiniertes SSH-Programm. Deaktivieren Sie die Funktion in den Einstellungen, um Kompatibilitätsprobleme auszuschließen!
################################################################
Used command:  /Users/richiwip/Entwicklung/testssh.sh -v -N -S none -o ControlMaster=no -o ExitOnForwardFailure=yes -o ConnectTimeout=10 -o NumberOfPasswordPrompts=3 -o TCPKeepAlive=no -o ServerAliveInterval=60 -o ServerAliveCountMax=1 richiwip@x.x.x.x -L 56526:10.0.21.20:3306

OpenSSH_7.3p1, LibreSSL 2.4.1
debug1: Reading configuration data /Users/richiwip/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Connecting to x.x.x.x [x.x.x.x] port 22.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /Users/richiwip/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/richiwip/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u3
debug1: match: OpenSSH_6.7p1 Debian-5+deb8u3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to x.x.x.x:22 as 'richiwip'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:iD4KdJaTABBPcEgEUXm3xZx2/MUJb7dXAcuQjVWr2bk
debug1: Host 'x.x.x.x' is known and matches the ECDSA host key.
debug1: Found key in /Users/richiwip/.ssh/known_hosts:89
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/richiwip/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/richiwip/.ssh/id_dsa
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 503
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 503
debug1: read_passphrase: can't open /dev/tty: Device not configured
debug1: permanently_drop_suid: 503
debug1: Trying private key: /Users/richiwip/.ssh/id_ecdsa
debug1: Trying private key: /Users/richiwip/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

I have configured a couple of shortcuts to various servers in my ssh config, but I haven't changed that since before Sequel stoped working.

@sarsonj
sarsonj commented Jan 3, 2017

@dmoagx thanks for your support. I tried it today - the only that changed is that I have 10.12.2 and it is working. Maybe problem with internal ssh client? I am not sure. If it happens again, I will let you know.

Jindrich

@dmoagx
Collaborator
dmoagx commented Jan 3, 2017

@RichiWIP There should be a file named userenv.txt on your Desktop. That is the one I was interested in.

@RichiWIP
RichiWIP commented Jan 4, 2017

OK, sorry. Here is the file.
userenv.txt

@dmoagx
Collaborator
dmoagx commented Jan 4, 2017

Hm, that looks as expected.
No idea what is going on there...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment