DataGrip and multi-hop SSH tunnel and ProxyCommand


I can see that similar questions to this have been asked before, but I've not been able to quite grok what's going on in the answers to those questions and whether they apply to my situation.

So, firstly, I'm running DataGrip (trial) on Windows 10 Pro with OpenSSH and my .ssh/config file contains some ProxyCommand stuff that deals with multi-hop/jump host logins. Here's the config (with server names redacted/changed of course):

Host server-*
User gazchap
ForwardAgent yes
TCPKeepAlive yes
ServerAliveInterval 120
ServerAliveCountMax 20
Host server-amz-*
ProxyCommand ssh -p 22101 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -W %h:%p

So, what I'm trying to do with DataGrip is connect to a MySQL 5 server that is only accessible from a server that matches the server-amz-* Host, in this example, server-amz-www1

The SSH tunnel I need is as follows:

Local machine > > server-amz-www1

I then need DataGrip to connect to server-mysql-1 *from* server-amz-www1 and server-amz-www1 use public key authentication.

I've tried various configurations in the SSH tunnel, but nothing appears to work - does DataGrip actually create the SSH tunnel(s) on demand, or do I need to create those first outside of DataGrip for it to use?

Creating the SSH tunnel manually with this command lets me connect to the database using HeidiSQL (by connecting to localhost:3308), but DataGrip doesn't like it.

ssh -L 3308:server-mysql-1:3306 server-amz-www1

Thanks in advance.

Comment actions Permalink

Looks like it should work. Please do this

1. Open Help | Debug Log Settings...

2. Add the following lines


3. Click OK

4. Reproduce the problem.

5. Upload logs from Help -> Collect logs and diagnostic data to and provide upload id here.

Comment actions Permalink

No need for the upload, thanks - checking the logs myself validated that actually it did all seem to be connecting through properly - the messages I was seeing weren't actually related to the SSH connection after all, but this issue instead:

Applying Workaround #1 on this page fixed it.

Thanks for your time :)


Please sign in to leave a comment.