PyCharm: Configuring multi-hop remote Interpreters via SSH

后端 未结 1 900
情书的邮戳
情书的邮戳 2020-12-13 02:38

To connect to the computer at my office I need to run ssh twice. First to connect to the host-1 and then from host-1 to host-2 and each one has different credentials. Howeve

相关标签:
1条回答
  • 2020-12-13 03:17

    You can use port forwarding on 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 be connected to the proxy now. You can substitute 6000 with any port.

    2. (optional) Test

    Now you can ssh into the target server on another terminal with:

    ssh -p 6000 <target_server_user>@localhost
    

    3. Configure PyCharm

    Keep in mind not to close the first terminal!

    The same goes for the PyCharm. Just set the remote interpreter connection through ssh with the following configuration:

    • host: localhost
    • port: 6000
    • user: target_server_user
    0 讨论(0)
提交回复
热议问题