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. However the configuration menu in Pycharm only accepts one ssh tunnel.
Configure Remote Python Interpreter dialog box
Is there any way to set a multi-hop ssh to have access to the interpreter and data files on the host from local?
You can launch an SSH Session right from PyCharm. By running commands in a dedicated SSH terminal, you can access data on a remote Web server or the default remote interpreter via an SSH tunnel, mainly upload and download files.
On the PyCharm welcome screen, select Remote Development. In the Run the IDE Remotely section, click Connect via SSH. 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.
PyCharm downloads the required version of JetBrains Client and opens the remote project inside it.
The central entry point to remote development with PyCharm is the notion of Remote Interpreters. You can configure PyCharm to use Python interpreter from a remote host and set it as your project interpreter. Then you can configure your run/debug configurations to run, debug or test your applications on the remote host.
You can use port forwarding on ssh.
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.
Now you can ssh into the target server on another terminal with:
ssh -p 6000 <target_server_user>@localhost
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With