-
Notifications
You must be signed in to change notification settings - Fork 778
TrustedUserCAKeys not working on a domain computer #1055
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
With a bit more testing I'm able to get the cert accepted, but can't complete the login due to the identity on the system not matching: The principal on the cert is
The username and cert principal matching appears to be handled by this function in sshkey.c I don't believe adjusting the principal will be an option because then of course this would break logins for Linux systems with identical user names, and it seems reasonable that matching the user portion of the domain\user combination on Windows would make this work. As an exercise I tried creating a custom ca_cert and signing a user cert with a principal as various domain\user combinations (contoso\dwatley, contoso\\dwatley) and could not get it to work, so I'm guessing there's some Windows specific work to be done here to make this a reality. Thoughts? This certainly isn't my expertise, but based on my findings my hope is that it would be relatively simple to implement. Again the end goal would be having an identical setup between Windows and Linux using an identical TrustedUserCAKey and signed user cert with the username (minus domain) as the principal on the cert. |
Now I'm able to login if I leverage the Auth user: contoso\dwatley I'm not sure this is how it's intended to work, but it works. I should also mention that environment variable expansion seems to work differently depending on the sshd_config option. For instance TrustedUserCAKeys allows the use of
I got around this with the sshd_config option implemented this way: |
FYI, We have a strict check that the PROGRAMDATA should be in the start of the file name.. We suggest full file paths in sshd config |
Right, in the sshd_config, |
@dwatley thanks for the detailed report. On Windows, in a domain environment, its necessary to fully qualify the user name to avoid resolution confusion - user with the same name can exist locally and in different reachable domains. Can you try signing your user cert with dwatley@contoso as principal? |
Thanks for the response. Signing with
My earlier comment regarding checking the username separately was strictly regarding the principal in the cert as I understand the domain is necessary to tie it to the correct user on a domain joined computer. Thinking about it more, considering it's possible to attach multiple principals to a cert that's probably the correct thing to do for a single user cert intended to be used cross platform? |
Yes. Your inferences seem right. I've added a reference to this thread in Certificate Usage Samples |
@dwatley - Thanks for pointing the path resolution issue of PROGRAMDATA in AuthorizedPrincipalsFile. There is a minor bug, I have fixed it. Here is the private binary. please take backup of sshd.exe, use private sshd.exe. |
@bagajjal - Confirming the |
@manojampalam / @NoMoreFood - Just re-iterating that the above all works with the TrustedUserCAKeys config option. Using the principals file, and/or signing with multiple principals. The format has changed to NetBios\SamAccountName based on the referenced issue. Thanks for all the work! |
"OpenSSH for Windows" version
v1.0.0.0-Beta
Server OperatingSystem
Windows 10 Enterprise
Client OperatingSystem
Windows 10 Enterprise
What is failing
TrustedUserCAKeys doesn't appear to be working for a domain computer running Windows. Identical setup (identical CA Key, identical signed user key) on non-domain computer running Linux works as expected. Should also add this is using a Yubikey device, though I don't believe that matters.
Actual output
Here is the DEBUG3 log of the failure.
For what it's worth, using authorized_keys works as expected with no issue, but being able to use the TrustedUserCAKeys feature would be much preferred. I'm not sure that the fact that this is a domain joined computer matters, but did want to specify that. My initial thought was maybe the way the user cert was signed might result in a different identity between the two platforms (Windows domain joined, Linux not). What other options are there for debugging this further beyond enabling DEBUG3 as I have already?
Relevant sshd_config params:
The text was updated successfully, but these errors were encountered: