"Server refused our key" error when setting up public/private keys [FIXED]
I'm at my wits end, and about to reinstall the entire server OS again just to see if I messed something up in my 5 hours of attempting to fix this issue.
I am using CentOS 7 64 bit.
ls -l in /home/user/.ssh directory returns this:
total 16
-rw-rw-r– 1 user user 0 Sep 3 12:57 authorized_key
-rw-r--r-- 1 user user 397 Sep 3 13:48 authorized_keys
-rw------- 1 user user 1675 Sep 3 00:54 id_rsa
-rw-r--r-- 1 user user 392 Sep 3 00:54 id_rsa.pub
-rw-r--r-- 1 user user 175 Sep 3 12:41 known_hosts
authorized_keys contains the public key generated in PuttyGen. Putty has its SSH Auth private key directed at the saved .ppk on my Windows client.
Any help is appreciated.
7 Replies
authorized_keys needs to be chmoded to 600 and owned by user:user
ls -la ~ returns .ssh file as:
drwx–---- 2 user user 4096 Sep 3 13:48 .ssh
ls -l ~/.ssh returns authorized_keys as:
-rw–----- 1 user user 397 Sep 3 13:48 authorized_keys
Terminal in PuTTy still returns "Server refused our key."
@derfy:
Check out /var/log/secure or /var/log/auth.log - those might help diagnose.
Well. It's hard to find the information needed when there's 64,840 lines in the file. What should I exactly be looking for? Most of the lines just tell me about the failed logins. That brings up another question of why there were over 6k failed attempted logins today alone for root, with my computer asleep and myself at work, and this server is only 3 days old.
316 in the past 45 minutes or so. That's peculiar…
Its been years since I've used putty but if I remember correctly putty uses a different format for public keys.
Make sure the public key you put in authorized_keys begins with 'ssh-rsa AAAA' ends with '==' and is all on one line.
@arlen:
There are 6k failed attempts because its the internet. People scan everything and try to login.
Its been years since I've used putty but if I remember correctly putty uses a different format for public keys.
Make sure the public key you put in authorized_keys begins with 'ssh-rsa AAAA' ends with '==' and is all on one line.
THANK YOU. That was the issue. The text they gave me to paste ended with "==rsa-keyxxxxx". Deleting that fixed it! And I figured so, but this is my first time being owner of a server, so it freaked me out a bit.