-
Notifications
You must be signed in to change notification settings - Fork 775
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
Document administrators_authorized_keys file permission requirements #1942
Comments
Also, I suggest to add some info in https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH (main installation intruction) about this:
will tell the system that your authorized keys are in ProgramData\ssh\administrators_authorized_keys, not in the users\username\.ssh\authorized_keys, as described in many articles and is more commonly used 'default' place (in my opinion).
Ps. I would really just comment that group administator rule in the config, as #1701 said it is hardly possible whilst debugging even with highest degree of detail to trace to the fact, that system expects another authorized keys filename because of its config, as you just see in the console debug log that server just ignore correct client pub key sending and goes to the next auth method (if exists), whilst having at the same time "correct" (in not that experienced user's mind) authorized_keys file that passes all fix checks of internal fix checker. At the same time config file might look at glance quite long, feature-rich, application-important and like a part of the whole project's internal source codebase (as it really is in some sense), which may not look like the thing to trick firstly if ever. |
In my opinion, to login with the administrators admin privilege should not be a default option. Naturally, it looks like an optional feature for who needs the admin privilege. |
Logging in as an administrator can be useful for SSHing into a desktop computer on a local network where security is less of an issue and we are just the owner of the computer, trying to access our other computer via a laptop. Otherwise, one needs to create an entirely new user, just for the purposes of SSHing into the machine, making the process of SSHing into our own machines more difficult than something like this should be. |
The fact that it is necessary to fiddle with
is a significant PITA for anyone who is setting up Windows Server virtual machine and want to streamline operations against the VM. For such environments security is not a concern at all e.g. used for testing and development; setting up Kubernetes with Windows nodes for testing (think Kubernetes SIG-Windows). Such use cases are important. |
"OpenSSH for Windows" version: 8.1.0.1
Server OperatingSystem: Windows 11 Pro, 21H2 build 22000.675
The documentation at docs.microsoft.com refers to the
administrators_authorized_keys
file being used by sshd to authenticate user accounts that are members of the administrator group.However, creating this file with proper public keys is not enough as it will inherit read permissions that must be removed before the file is accepted by sshd.
Plenty of people have been struggling with this, see fx https://stackoverflow.com/a/64868357/936466
I suggest improving the documentation at docs.microsoft.com.
An even better alternative would be to drop the
administrators_authorized_keys
concept entirely (discussed in #1324).refs #1701
The text was updated successfully, but these errors were encountered: