Windows OpenSSH Permission denied issue
- Password login is possible (although disabled in the settings)
Permission deniedoccurs when using public key authentication
When connecting to localhost:22, the following error occurs:
hikari@localhost: Permission denied (publickey,keyboard-interactive).

Cause
It appears that the Administrators group, i.e., "administrator users", is referencing the public key in C:\ProgramData\ssh\administrators_authorized_keys for authentication by default.
Change this to $env:userprofile\.ssh\authorized_keys.
Solution
Open C:\ProgramData\ssh\sshd_config with administrator privileges and comment out the following two lines:

- Match Group administrators
- AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
+ #Match Group administrators
+ # AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
After saving, restart the service.
Restart-Service sshd












