Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm SSH tunneling via local ssh config (~/.ssh/config)

I use ssh deployment on servers via ssh tunnels, and each of its has specific options and port forwarding placed in ~/.ssh/config.

PyCharm uses by default its own ssh client when using SFTP deploy. So, it doesn't work with these deployment servers. How I could force PyCharm to use my default system ssh client or force to use options from ~/.ssh/config file. Thanks.

PS: PyCharm version is 3.0.1

like image 361
skybobbi Avatar asked Nov 06 '13 02:11

skybobbi


People also ask

How do I connect to a remote server in PyCharm?

On the PyCharm welcome screen, select Remote Development. In the Run the IDE Remotely section, click SSH Connection. If you have the IDE already running on the remote server and you have a connection link, you can use the Connect to Remote Host With a Link section.


1 Answers

Provided PyCharm can be made to use port different than 22 (don't know that), you actually have two workarounds:

  • Simple workaround

Use port forwarding on localhost:

http://www.debian-administration.org/article/449/SSH_dynamic_port_forwarding_with_SOCKS

..and either use -F specific_config for each tunnel, or use -o to specify relevant options (that you normally have in ~/.ssh/config on ssh commandline) directly. Of course, you have to tell PyCharm to connect to localhost:forwarded_port.

  • Fancy/sophisticated workaround

Use dynamic port forwarding + tsocks, again described in:

http://www.debian-administration.org/article/449/SSH_dynamic_port_forwarding_with_SOCKS

like image 195
LetMeSOThat4U Avatar answered Sep 28 '22 04:09

LetMeSOThat4U