-
Notifications
You must be signed in to change notification settings - Fork 18k
x/build/cmd/gomote: add "gomote rdp" #26090
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
Comments
/cc @dmitshur |
Perhaps the best way to implement this is to just fix our "gomote ssh" support to pass-through port forwarding requests. (perhaps filtered) And because we support ssh to Windows buildlets, a user wanting gomote rdp could just "gomote ssh -L3389:localhost:3389 ..." |
That also might mean you could fix the ssh scp/sftp channel support at the same time, which is currently a TODO in the code. |
I investigated the current state of port forwarding, since this was also my first idea for how to implement this under the hood. To test things, I started a simple HTTP server responding on port 8080 on a buildlet
And tried to:
The ssh client printed the following error:
So, port forwarding isn't currently working (at least not for linux-amd64 buildlets), and I want to figure out which layer along the ssh proxying pipeline the "port forwarding is disabled" error is coming from (i.e., where it needs to be enabled).
Did you have something specific in mind @bradfitz? What kind of filtering would we want (and why, given how buildlets are meant to run arbitrary things as long as the user has access)? |
If you wanted to do it at the ssh level, we might just get it for free if you did #21140 (comment) (the io.Copy pairs proxying ssh channel requests). Or pretty close. But rather than mess with that, the other option is to do it with magic on gomote client and coordinator. Flow with the non-ssh option would be:
Later we could generalize this to other port numbers if needed. Perhaps we could even use this for port 22 (or internal port 2200) so things like scp/sftp for #21140 work, avoiding the cmd/coordinator ssh server in most cases (except plan9). |
I'm looking at that issue simultaneously. I experimented with doing ptyReq, winCh, isPty := s.Pty()
if !isPty {
fmt.Fprintf(s, "scp etc not yet supported; https://golang.org/issue/21140\n")
return
} So in the case of It might make sense to work on the
If I understand you correctly, you're suggesting implementing rdp with the same general approach as ssh is implemented (except more directly, without an extra SSH server in between), right? If so, that makes sense, and it was the other very clear resolution path I have considered. However, you go on to say:
This is very intriguing. You're suggesting that it might be possible and desirable to simplify the current ssh implementation by getting rid of the middle-layer SSH server, and just proxying a raw TCP connection from the user's local machine (running If so, I'd be very eager to try to go in that direction, because it'd be very nice to reduce the complexity of the current solution and be able to solve scp/ssh port forwarding and any other issues just by being a dumb TCP proxy (which is easy) rather than a SSH proxy (can be harder to support all features and be confident about correctness). |
Yup, that's what I was implying. The only downside is that it removes some control from us. For instance, it lets any gomote ssh user setup TCP tunnels from anywhere to anywhere on their own once they're in. But--- we're already giving them full code execution by design, so it doesn't really matter. We already have to fully trust these users. Note we'll still need to keep the middle-layer ssh server for plan9. |
A year later and @aclements needs this again. Fortunately I wrote a design above that I still like, so I'll look into this today. |
Fortunately, our Windows machines have RDP enabled:
|
Change https://golang.org/cl/207357 mentions this issue: |
Change https://golang.org/cl/207378 mentions this issue: |
Updates golang/go#26090 Change-Id: I095f70baceb23cf28fcd70a78fd72df29603370e Reviewed-on: https://go-review.googlesource.com/c/build/+/207357 Reviewed-by: Bryan C. Mills <[email protected]>
Filed #35629 to make the Windows environment better once we're RDP'ed in. /cc @aclements @cherrymui |
For Windows builders, occasionally we want GUI/desktop access.
Add a "gomote rdp" to proxy a gomote buildlet's TCP port 3389 to gomote client's localhost:3389, restricted to same users who have "gomote ssh" access.
/cc @aclements
The text was updated successfully, but these errors were encountered: