3

I try to connect to a remote machine that is behind a gateway for debug and deploy.

By setting ~/.ssh/config to

Host target_machine_name
    ProxyCommand ssh gateway_machine -W %h:%p

I can ssh from the command line to that machine (with: ssh target_machine_name)

However, when I try to "configure remote python interpreter", I end up with the following error:

java.net.UnknownHostException: target_machine_name

Any idea how to forward the communication in a manner that be supported by java.net?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Yuval Atzmon
  • 5,645
  • 3
  • 41
  • 74

1 Answers1

2

I managed to solved the issue, by replacing the tunneling, with an explicit ssh tunneling command, as in this answer

ssh -N -L localhost:2260:target_machine_name:22 gateway_machine

and directing ssh to localhost with port 2260

Community
  • 1
  • 1
Yuval Atzmon
  • 5,645
  • 3
  • 41
  • 74
  • 1
    Did you add this line to the `.ssh/config` file? as ``` Host target_machine_name ProxyCommand ssh -N -L localhost:2260:target_machine_name:22 gateway_machine``` – Wei Yang Dec 18 '17 at 18:25
  • 1
    there's a better explanation here https://stackoverflow.com/questions/37827685/pycharm-configuring-multi-hop-remote-interpreters-via-ssh/38212999 – nivniv Oct 02 '18 at 06:39