Search code examples
sshdatagrip

Configure terminal SSH command in DataGrip SSH tunnel


I use this SSH terminal command to see my DBs in DataGrip:

ssh -L IP1:Port1:IP11:Port11 -L IP2:Port2:IP22:Port22 -L IP3:Port3:IP33:Port33 username@IP4

After executing above command, it ask me username's password.

After entering correct password, it asks me to choose the desired site from list.

After all it connects, and then I can see my DBs in DataGrip.

How can I configure these steps in DataGrip SSH tunnel?

enter image description here

To have no SSH terminal connection any more.


Solution

  • Performing the following steps should help:

    • set up your ~/.ssh/config file for IP4 host to use LocalForward:
    Host IP4
    LocalForward IP1:Port1 IP11:Port11
    LocalForward IP2:Port2 IP22:Port22
    LocalForward IP3:Port3 IP33:Port33
    
    • create the SSH configuration for your IP4 host (Settings | Tools | SSH Configurations) and select Parse config file option (or just choose OpenSSH config... as Authentication type);
    • add this configuration under the enabled Use SSH Tunnel option on your screenshot.