SSH from PuTTy to Debian "authorized_keys is not a regular file" Error

nojak asked:

I cannot connect from my Windows 7 computer using PuTTy to a newly configured Debian Squeeze server using SSH RSA key authentication.

I get this error when running SSH in debug mode:
User myuser authorized keys /home/myuser/.ssh/authorized_keys is not a regular file

What I’ve done so far:

  1. ssh-keygen -t rsa
  2. Set passphrase.
  3. Copied the file to ~/.ssh/authorized_keys
  4. Copied the id_rsa to a text file on my Windows 7 machine
  5. Imported the key into puttygen.exe and converted it to a .ppk private key file.
  6. Loaded that private key file into pageant.exe and made sure Connection->SSH->Auth Authetication methods had “Attempt authenticaiton using Pageant” checked.
  7. Loaded the profile.

Based off of the FAQ from, I changed the permissions to the following:

drwxr-xr-x 3 root   root   4096 Aug 13 14:16 /home
drwxr-xr-x 7 myuser myuser 4096 Aug 17 12:55 /home/myuser
drwx------ 3 myuser myuser 4096 Aug 17 13:24 /home/myuser/.ssh
drw------- 2 myuser myuser 4.0K Aug 17 13:23 /home/myuser/.ssh/authorized_keys
-rw------- 1 myuser myuser  396 Aug 17 13:17 /home/myuser/.ssh/authorized_keys/

I started debug mode on ssh, and got the following:

debug1: userauth-request for user myuser service ssh-connection method publickey
debug1: attempt 1 failures 0
debug1: test whether pkalg/pkblob are acceptable
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: temporarily_use_uid: 1000/1000 (e=0/0)
debug1: trying public key file /home/myuser/.ssh/authorized_keys
User myuser authorized keys /home/myuser/.ssh/authorized_keys is not a regular file
debug1: restore_uid: 0/0
Failed publickey for myuser from port 50710 ssh2

I’m at a loss as to what else to check. I haven’t setup SELinux or anything. Any ideas would be much appreciated.

My answer:

The problem is:

User myuser authorized keys /home/myuser/.ssh/authorized_keys is not a regular file

It appears you’ve made a directory named authorized_keys and put all your key files in it. This is why it’s not working. authorized_keys is meant to be a regular file, and you can put all your keys in ~/.ssh.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.