PyCharm: Configuring Remote Interpreters with Multiple Transitions Through SSH

To connect to a computer in my office, I need to run ssh twice. First connect to host-1, and then from host-1 to host-2, and each of them has different credentials. However, the configuration menu in Pycharm accepts only one ssh tunnel.

Configure Python Remote Interpreter Dialog Box

Is there a way to install multi-hop ssh to access the interpreter and data files on the host from the local one?

+21
python ssh pycharm ssh-tunnel
source share
1 answer

You can use port forwarding over ssh.

1. Open a terminal and run:

On your local system:

ssh -L 6000:<target_server_ip>:22 <proxy_server_user>@<proxy_server_ip> 

You should now be connected to the proxy server . You can replace 6000 with any port.

2. (optional) Test

Now you can connect to the target server on another terminal with:

 ssh -p 6000 <target_server_user>@localhost 

3. Configure PyCharm

Do not close the first terminal!

The same goes for PyCharm. Just connect to the remote translator via ssh with the following configuration:

  • host: localhost
  • port: 6000
  • user: target_server_user
+33
source share

All Articles