-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add hostlogin to proxy config for windows desktop #12775
Conversation
lib/web/desktop.go
Outdated
@@ -193,6 +193,7 @@ func proxyClient(ctx context.Context, sessCtx *SessionContext, addr string) (*cl | |||
if err := cfg.ParseProxyHost(addr); err != nil { | |||
return nil, trace.Wrap(err) | |||
} | |||
cfg.HostLogin = sessCtx.user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically HostLogin
should be the user on the target host, which we have in the username
variable we pull from the query string on line 92.
It doesn't really matter, as this is only used when using the ProxyClient
to connect to an SSH node, but we do have more accurate information so we might as well use it.
I would also add a comment here:
// HostLogin must be specified in order to avoid defaulting to
// the local Unix user, which will fail in some environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: I had time and realized it would be several hours before you're awake, so I went ahead and made the change. Let me know what you think!
Also convert a few TLS handshakes to a context-aware version for better timeout/cancelation behavior.
@rcanderson23 See the table below for backport results.
|
Resolves https://github.com/gravitational/cloud/issues/1635 and #12706
When
HostLogin
is not set, it attempts to default to the username of the current linux user. This fails when running containers as an arbitrary UID and there is no matching user in/etc/passwd
. This value doesn't appear to be used by Windows Desktop Services so it just needs to be set to something to avoid the issue.