PyCharm and VS Code provide remote debugging features. Let’s see how to implement it, respectively.
Before continue, you need to know some knowledge on ssh from my previous blog.
No gateway/proxy between local machine and remote machine
Before remote development, we need to config the SSH for VS Code.
remote explore, click
config, add the following code to SSH configeration file
Host remote1 HostName remote-host-name User username IdentityFile XXX\.ssh\id_rsa
IdentityFilepath should be the private key path which was generated following this blog (If you have already generate the key in VS Code terminal, then you can remote this line)
- The first connection may require password, after that you can connect remote machine without password.
The above content can also be found as the first chapter of this blog.But the second part of this blog is too complex. Do not use it.
After we successfully connect to remote machine, we can open the remote directory/file using VS Code and run the code directly using the remote Python interpreter (
Python: interpreter to select your prefer interpreter).
Gateway/proxy between local machine and remote machine
The same process with the aforementioned No gateway method, the only thing we need to pay attention is to build password-less SSH connection via gateway following this blog
Host remote2 HostName remote-host-name User username ProxyJump username@gateway-host-name:22