SSH Tunnel over HTTP Proxy
My work network requires all outgoing traffic to go through their corporate proxy. Also, to connect to our mySQL server, we need to do SSH tunneling.
I am able to get system ssh command working through the proxy by using corkscrew and can connect to our server successfully. I am also able to connect via SequelPro app, as that just uses regular ssh commands in the background. I am unable to connect via DataGrip.
It looks like DataGrip uses jSch library for SSH tunneling and there do not seem to be any settings to set up the proxy to use for the tunneling. It does not seem to take the proxy settings from Preferences -> System Settings -> HTTP Proxy for the tunneling and just throws an exception when trying to connect.
jSch library does support going through a proxy as can be seen in the example here, it just needs to be configured: http://www.jcraft.com/jsch/examples/ViaHTTP.java.html
Can you take a look at the issue?
Thanks.
请先登录再写评论。
I'm facing the same issue. Is there any solution for that?
Hi Bumistr, Leonardo,
I have taken a look at Corkscrew documentation on GitHub:
Setting up Corkscrew with SSH/OpenSSH is very simple. Adding the following line to your
~/.ssh/config
file will usually do the trick (replaceproxy.example.com
and8080
with correct values):DataGrip supports using ProxyCommand instruction defined in ~/.ssh/config file. To enable reading this file in DataGrip please use OpenSSH Config and authentication agent option for Auth type in SSH Tunnel configuration in database connection settings.
To be able to authenticate to SSH server using this Auth type please make sure that your identity file is set with IdentityFile instruction in ~/.ssh/config or added to ssh-agent using
ssh-add
command