Clarify steps for debugging over SSH
https://github.com/Microsoft/vscode-docs/blob/master/docs/python/debugging.md#L309-L333
The instructions here need to be made explicit so that a newbie to SSH can follow them and have success.
Specific needs:
- The steps needed on the remote computer. Current docs indicate to modify sshd_config but it isn't clear what else needs to be done. Is there an ssh command that needs to be run? Is there a service that needs to be restarted?
- Verify that the above is all that's needed before running the program that contains ptvsd.wait_for_attach.
- Validate the local steps, and give an explicit example.
@Resousse, I was wondering if you could help with this. Your original writeup on https://github.com/DonJayamanne/pythonVSCode/issues/350 has since migrated from Don's wiki to the VS Code documentation, https://code.visualstudio.com/docs/python/debugging#_remote-debugging, which I own (and for which this is the repo).
Specifically, I want to spell out the steps much more explicitly, because being someone who hasn't worked with SSH much, some of the details elude me. I'd like to get these instructions to the point where a newbie can have success with it. (I've already tried to do the same with the remote debugging section that precedes it.)
We can just have the conversation here in the issue. Thanks.
Hello @kraigb,
About your points:
The steps needed on the remote computer. Current docs indicate to modify sshd_config but it isn't clear what else needs to be done. Is there an ssh command that needs to be run? Is there a service that needs to be restarted?
Actually, in the sshd_config, the directive AllowTcpForwarding must be set to yes (append it if not existing).
Then, the ssh server must be restarted to take this into account
Verify that the above is all that's needed before running the program that contains ptvsd.wait_for_attach.
As soon as the user is able to enable port forwarding, the user is able to connect on the remote, and the user is able to launch the program listeting on a debug network port, the debug should work.
Validate the local steps, and give an explicit example.
When in a ssh tunnel, the remote host (put in the VSCode) must not be the actual remote host ip or hostname, but must be always localhost as the entrypoint of the ssh tunnel is on the local network port.
Let me know if I misunderstood something. Thanks
@Resousse Thanks a bunch (belatedly) for your help.