Hello Reprobus R, welcome to Microsoft Q&A forum.
The C:\ProgramData\ssh\administrators_authorized_keys path mentioned earlier only applies to administrator accounts, not standard users. The "permission denied" error for standard users is usually due to private key file permissions. Here's the fix:
- Open PowerShell as Administrator
- Set permissions on your private key (not authorized_keys):
icacls "C:\Users\YourUsername\.ssh\id_rsa" /inheritance:r
icacls "C:\Users\YourUsername\.ssh\id_rsa" /grant:r "YourUsername:(R)"
- Remove other groups if present:
icacls "C:\Users\YourUsername\.ssh\id_rsa" /remove "Authenticated Users" "Users" "Everyone"
- Restart SSH service:
Restart-Service sshd
The key should now only be readable by your account.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.