Hi Aidan,
I tried these patches with OpenSSH Server installed from Windows Features and public key
authorization does not work. Guest OS Windows Server 2022. Do you expect to use OpenSSH
from Windows Features or not?
As OpenSSH Server is a build feature for Server 2022 and new versions of Windows 10/11, I expect
that patch should work with it too.
```
If you downloaded the OpenSSH beta from the GitHub repo at
PowerShell/Win32-OpenSSH, follow the instructions listed there, not the ones in this article
```
So, why we should look at beta version behavior while MS provides a stable one from Features?
I debug the problem and the reason for ignoring SSH keys is the permissions of administrators_authorized_keys.
SSH server does not allow S-1-5-11 and S-1-1-0 permission.
4384 2024-04-22 01:19:57.763 debug1: trying public key file __PROGRAMDATA__/ssh/administrators_authorized_keys
4384 2024-04-22 01:19:57.763 debug3: Bad permissions. Try removing permissions for user: \\Everyone (S-1-1-0) on file C:/ProgramData/ssh/administrators_authorized_keys.
4384 2024-04-22 01:19:57.763 Authentication refused.
6824 2024-04-22 01:21:13.966 debug1: trying public key file __PROGRAMDATA__/ssh/administrators_authorized_keys
6824 2024-04-22 01:21:13.966 debug3: Bad permissions. Try removing permissions for user: NT AUTHORITY\\Authenticated Users (S-1-5-11) on file C:/ProgramData/ssh/administrators_authorized_keys.
6824 2024-04-22 01:21:13.966 Authentication refused.
I attached 2 screenshots of permissions. The first one with permission that file has after
guest-ssh-add-authorized-keys command and the second one with proper permissions
to make the SSH server happy.
Best Regards,
Konstantin Kostiuk.