I have a Windows 10 machine running OpenSSH that I need to connect to over SSH using PuTTY. I have created a public/private key on the Host machine using PuTTYgen. I loaded the public into the user's profile directory under .ssh/authorized_keys. When I connect with PuTTY from a machine outside the network I get this error message:
"Server refused our key"
I have read several posts and they all indicate the public key is not being read correctly. I have made the following changes with no success.
None of these attempts have cleared up the problem. I have never set up SSH on a Windows 10 host before so I am out of ideas. I set up logging in sshd_config but there are no log files being generated.
Can someone help me get this figured out?
First, as in this tutorial, make sure to copy an OpenSSH public key
The OpenSSH public key is located in the box under
Key / Public key for pasting info OpenSSH authorized_keys file
:. The public key begins withssh-rsa
followed by a string of characters.
Second, as in this gist, launch sshd -d
to get a one time session in debug mode: you will see more clues as to why it rejects your public key.
The OP gacto confirms in the comments:
sshd -d
gave me the information I needed.It was a file permissions issue. I had set the file permissions to the specifications from the OpenSSH setup instructions, but access to the file was getting blocked.
Once I updated the file permissions, I was able to connect without any trouble.