1

Ubuntu 14.04LTS running openssh. I'm getting a Permission denied (public key) when I try to ssh in using my public key.

/var/log/auth.log shows "Could not open authorized keys '/home/wolfgeek/.ssh/authorized_keys': Permission denied"

HERE IS THE STRANGE PART!

If I do "ls -l /home/wolfgeek/.ssh/authorized_keys" or "stat /home/wolfgeek/.ssh/authorized_keys", I can then successfully log in via ssh. I have not changed the permissions on the file (600) nor on the .ssh directory (700). I have not modified the file, nor restarted sshd. All I do is stat the file and it starts working.

Any ideas?

2
  • Is this /home/wolfgeek/.ssh directory on an NFS volume? Or some other shared filesystem or unusual (for unix) filesystem type? It's possible that the OS is caching file attributes and not seeing changes to the file right away.
    – Kenster
    Commented Jul 25, 2014 at 20:11
  • Nope, it's a standard ext4 filesystem. Neither the file nor the permissions change between when it works and when it doesn't. After doing the ls -l, it works for some amount of time (like 20 mins or so) and then stops working again.
    – wolfgeek
    Commented Jul 25, 2014 at 20:15

1 Answer 1

1

the file should be 600, the directory 700.

chmod go-w ~
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

That the permissions formula I always use. I'm running debian, but should work the same for ubuntu

1
  • Nope, that didn't fix it. I already had those permissions.
    – wolfgeek
    Commented Jul 25, 2014 at 20:04

You must log in to answer this question.

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