I am using Windows 10 and Raspbian Buster on a Raspberry Pi 3B+, and am unable to use keys to login to the Pi. I get the error "Server refused our key" every time.

I have created public and private keys using PuttyGen following this section of the ssh.com. I have saved the private key to my Windows machine and encrypted it with a password. I then copied the Public SSH key that Putty generates (shown here for clarity). I have saved the public key into the location ~/.ssh/authorized_keys.

I'm not sure what is going wrong, and I would appreciate any help.

EDIT: I am not using the default pi username, if this makes a difference. Upon looking at the ls -l ~/.ssh output, it shows the following: -rw-r--r-- 1 <MyUsername> <MyUsername> 1065 Jan 14 00:21 authorized_keys

I have looked at the following sites for help, but none of them have fixed the issue

Site 1 Site 2 Site 3 Site 4

  • in your home directory, type chmod go-rwx .ssh ... a group/other writable .ssh directory will cause this issue - by the way, I make both .ssh and any file inside it with chmod go-rwx - not strictly required, but that's just a habit ... i.e. chmod -R go-rwx .ssh – Jaromanda X Jan 14 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.