Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In an effort to get SSH keys working I'm tailing the sshd authorization log and I see these lines:

debug1: test whether pkalg/pkblob are acceptable
debug1: temporarily_use_uid: 10144/10029 (e=0/0)
debug1: trying public key file /home/cklein/.ssh/authorized_keys
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 10144/10029 (e=0/0)
debug1: trying public key file /home/cklein/.ssh/authorized_keys2
debug1: restore_uid: 0/0
Failed publickey for cklein from port 46583 ssh2

But if I check the /home/cklein/.ssh/ directory it looks like this:

$ ls -al /home/cklein/.ssh/
total 16
drwx------. 2 cklein infoarch 4096 May  3 16:39 .
drwxr-x--x. 9 cklein infoarch 4096 May  3 16:39 ..
-rw-------. 1 cklein infoarch  605 May  3 16:39 authorized_keys
-rw-r--r--. 1 cklein infoarch  226 Apr  4 16:11 known_hosts

I used to have an authorized_keys2 file in that directory, but removed it and have since restarted sshd. Why is it still expecting that file to exist?

Also, do you have any guesses as to why the public key is getting rejected?

share|improve this question
Is there a public/private key pair in that directory? I didn't see it in the above output from the .ssh directory. – slm May 4 '13 at 2:24
What distro is this too, BTW? Is this an older system or a recent one? – slm May 4 '13 at 2:28
up vote 3 down vote accepted

By default, the OpenSSH server will look for authorized keys in .ssh/authorized_keys and .ssh/authorized_keys2 unless you set a different value for AuthorizedKeysFile in the configuration file at /etc/ssh/sshd_config.

For the rest, I can't see any key file in the directory listing. Have you generated one using the ssh-keygen command?

share|improve this answer
That is the directory listing of .ssh on the server, not the client. I feel confident that the contents of .ssh on the client are good because my sshkeys work with other machines. – Cory Klein May 3 '13 at 21:34
Hum. Unless the correct key is not in the authorized_keys file, I can't see why it's not working. Try to get more information by raising the debugging level: ssh -vvv. – Spack May 3 '13 at 22:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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