I setup a private key on my server. I followed this tutorial -> http://linux-sxs.org/networking/openssh.putty.html

All was working fine. I connected via putty and it all worked.

Then yesterday I rebooted my server and now I get this:

Server refused our key

I upgraded some packages, might that be the cause or is it suppose to fail after some time?

This is what I have in ~/.ssh

antoniocs@acsserver:~/.ssh$ ls -la
total 44
drwx------ 2 antoniocs antoniocs 4096 2009-07-27 22:37 .
drwxr-xr-x 8 antoniocs antoniocs 4096 2009-08-04 11:19 ..
-rw-r--r-- 1 antoniocs antoniocs  401 2009-07-27 22:37 authorized_keys
-rw------- 1 antoniocs antoniocs 1675 2009-07-27 22:25 id_rsa
-rw-r--r-- 1 antoniocs antoniocs  401 2009-07-27 22:25 id_rsa.pub

I didn't change any permissions.

  • 1
    Even though you provided a link, I would explain what you are doing more, what tools , steps you have taken etc. – Kyle Brandt Aug 4 '09 at 17:41
  • The permissions on your actual home directory are significant too (ls -adl). Also, did you check the suggested log file for entries at the time you tried to login via key? – David Spillett Aug 4 '09 at 21:11
  • Also, post your sshd_config. It does have RSAAuthentication yes, right? – MikeyB Dec 9 '11 at 3:19

is it possible that you upgraded ssh and black-list of insecure ssh keys related to debian/ubuntu problems with random number generator?

try re-generating keys again - does the problem stil occure?

  • Indeed this happened after the upgrade I performed on the server. I will try this and report back here. Thanks – AntonioCS Aug 5 '09 at 10:05

The most common cause of a key, otherwise correctly configured, being refused is file permissions on home directory, your ~/.ssh directory, and the authorized_keys file within it. They should be set such that no other user can write/delete/replace them.

If this is the cause of your trouble then this will be logged on the server (usually in '/var/log/auth.log' or similar) in an obvious manner. This log file will may include other useful info if the problem is something else.

Another error that I've seen more than once is uploading the private key instead of the public one. If you have done that then you should generate a new key pair and lose the old one for paranoia's sake.


I had a problem after having successfully logged into our server with PuTTY and SSH for months. I suddenly started receiving the "Server refused our key" message.

A quick review of /var/log/secure (after an hour of trying to "fix" things first) revealed the issue:

"Invalid permissions on /home/myuser directory".

Sure enough, the PARENT directory of the .ssh directory had permissions set to 775 (rwxrwxr-x) instead of 755 (rwxr-xr-x).

Turns out the parent directory CAN NOT have write permissions for group or world. This is considered a break in security and thus SSH deems the authorized keys file insecure.

A simple chmod 755 /home/myuser fixed the problem.

HTH someone out there.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.