1

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 192.168.8.165 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?

2
  • 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, 2013 at 2:24
  • What distro is this too, BTW? Is this an older system or a recent one?
    – slm
    May 4, 2013 at 2:28

1 Answer 1

3

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?

2
  • 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, 2013 at 21:34
  • 1
    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, 2013 at 22:09

You must log in to answer this question.

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