Answer the question
In order to leave comments, you need to log in
OpenSSH on Windows 10. Why is access denied?
Good afternoon. There was a question with authorization in Windows OpenSSH on a key.
Before that, I had several times to configure without keys (only with a password) and everything seemed to be ok.
This time I decided to make authorization only by SSH key and ran into Permission denied (publickey,keyboard-interactive).
Briefly about the server:
Server - Windows 10
User - local account (with administrator rights)
The public key is located in authorized_keys in the user directory (C:\Users\LocalUser\.ssh\authorized_keys).
All sorts of restarts and reboots were.
OpenSSH server installed: (I tried both options just in case)
1) Settings -> Applications -> Additional Components -> OpenSSH Server
2) Via
PowerShell according to the official instructions
Windows inbox Beta version currently supports one key type (ed25519).
debug1: identity file C:\\Users\\LocalUser/.ssh/id_rsa type 0
debug1: identity file C:\\Users\\LocalUser/.ssh/id_ed25519 type -1
debug1: identity file C:\\Users\\LocalUser/.ssh/id_ed25519 type 3
debug3: Failed to open file:C:/Users/LocalUser/.ssh/id_ed25519-cert error:2
debug3: Failed to open file:C:/Users/LocalUser/.ssh/id_ed25519-cert.pub error:2
debug1: identity file C:\\Users\\LocalUser/.ssh/id_ed25519-cert type -1
debug1: Offering public key: C:\\Users\\LocalUser/.ssh/id_ed25519 ED25519 SHA256:xKMs9i1ZJyeQjvIY3jL2WIZnGNwOr6v/7QLUPu9t2Nw explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
Answer the question
In order to leave comments, you need to log in
I got to the computer, I'll write it here :)
In the server logs, you can see what the problem is - the rights of the same file that I mentioned in the comment are not the same
debug3: Bad permissions. Try removing permissions for user: S-1-5-11 on file C:/ProgramData/ssh/administrators_authorized_keys.
Authentication refused.
$acl = Get-Acl C:\ProgramData\ssh\ssh_host_dsa_key.pub
Set-Acl -Path C:\ProgramData\ssh\administrators_authorized_keys -Acl $acl
Match Group administrators
AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
But this is not recommended Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question