-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Remote-SSH Bug]: New "Use Exec Server" option binds to localhost only #9713
Comments
From looking at the code, when we start the server in the previous/traditional metho we always passed |
The vscode-shell-proxy that we wrote to push VSCode onto compute nodes via the Slurm job scheduler intercepts the commands that the user's local VSCode is sending and catches the |
Gotcha. I'm not especially keen to do this. It worked for you before because of the way the arguments were laid out, but this was pretty much happenstance, and there's no (other) reason that I would recommend setting up something on your system to handle forwarding between interfaces. If you're on Linux, I think iptables can do this for you: https://superuser.com/questions/684275/how-to-forward-packets-between-two-interfaces. Or if you happen to have Node.js on the box, a small program |
I think the point is being missed here: vscode's remote-ssh extension is not designed to work in any circumstance other than the user's wanting the remote server component to run directly on the system into which s/he has ssh'ed. That 100% is not compatible with HPC systems, where access to pertinent hardware is gated through a head/login node and a job scheduler. The reason we've had to go to the effort to proxy remote-ssh access is because our users were leaving behind hundreds of orphaned process trees on the login nodes. We'd rather not ban its use entirely, but that's where things are headed. Yes, it is less secure to have the remote server listening on any interface other than loopback; that's true for any software ever written that opens network sockets. Apache is less secure the moment I plumb it to an external interface, but it serves no purpose to me otherwise. You're assuming no utility to something that has utility when the user/sysadmin accepts the risk and responsibility associated with listening on a routed interface. Your suggestion re: iptables and port forwarding/proxying just complicates the system further and accomplishes the same thing that would be accomplished far more simply and efficiently if the CLI remote server accepted and honored So the question is: why not implement the same |
Thanks for the info. I think the preferable approach to take in this case is actually having a proper Will be on Monday's VS Code Insiders https://code.visualstudio.com/insiders/ and the prerelease version of the Remote - SSH extension. Please let me know if it works for you. You can also work around it by reverting to the 'old mode' by setting I don't plan to promote this at a patch to this month's release at this time. |
Offering a singular global option to determine that behavior is not a good implementation. If I need just 1 of the N ssh hosts I've configured to not bind to loopback, I have to have all N do that. That's insecurity for the sake of simplicity. The same issue of configuration granularity exists with most other remote-ssh options. The "Use Exec Server" option that started this issue is implemented as a global binary choice, for example, where per-profile configurability (e.g. override the default in an advanced configuration mode) would be useful to the end user. Effectively all of the options that are marked with "(Applies to all profiles)" would be more useful that way, though certainly less simple and straightforward to implement on the client side. Your suggestion of |
Fair, updated it to a map |
Is there an existing issue for this bug?
Required Troubleshooting Steps
remote.SSH.useLocalServer
settingConnect Locally
It connects successfully
->
No response
Expected Behavior
The Bash/node.js vscode-server infrastructure opens and binds its TCP listener to all interfaces. The exec server only binds its TCP listener to the loopback interface. Visibility of the listener is radically different between the two and (seems to be) non-configurable in the exec server.
This becomes a major issue on HPC clusters, for example, where users need to access GPU hardware via a job scheduler and we do not want them to be consuming limited resources on login nodes. I've already written and deployed a proxy (which is executed as the Remote-SSH "Remote Command" on the connection) which schedules the remote session via the job scheduler. It works fine with the Bash/node.js infrastructure because the proxy can connect to the listener port on the compute node. It does not work with the exec server because a port bound solely to loopback isn't reachable from another node in the cluster.
If the default interface binding for the exec server MUST be "localhost," can the
command-shell
subcommand at least have an option to override that and bind to*
or a specific IP?Steps To Reproduce
No response
Remote-SSH Log
Remote-SSH Log
Our proxy receives the
line from the remote CLI server and opens a listening port on the login node whose port# is substituted and returned to the vscode client. When the vscode client connects, the proxy attempts to connect to 45678 on the compute node running the interactive job — but since it's bound to loopback only, that fails.
This worked with the Bash/node.js infrastructure because the listening port was bound to all interfaces and simply responded with
for which the proxy's listening port on the login node was substituted in the response to the vscode client. The client connects through the tunnel, the proxy connects to the port on the compute node, and communication is established.
Anything else?
No response
The text was updated successfully, but these errors were encountered: