1

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.

3
  • 1
    Even though you provided a link, I would explain what you are doing more, what tools , steps you have taken etc. Commented Aug 4, 2009 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? Commented Aug 4, 2009 at 21:11
  • Also, post your sshd_config. It does have RSAAuthentication yes, right?
    – MikeyB
    Commented Dec 9, 2011 at 3:19

3 Answers 3

2

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?

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

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.

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .