i'm trying to set up ssh to allow me to login as myself (let's say my username is fred). currently there is a public key in /root/.ssh/authorized_keys that works, but i login as root with fred's password. it's kind of weird. what i want is to have /home/fred/.ssh/authorized_keys to have a pubic key for logging in as fred, but the remote server seems to be flat out ignorning that file. i've tried creating the keys with puttygen on my local computer, and also creating the keys on the remote server. i also did remember to reload the service after making changes.i keep getting: Using username "fred""Server refused our key"do i have to do something special to get sshd to look into the specified user's authorized_keys file?
4/15/2008 2:57:44 PM
The most common problem is permissions on the user's .ssh folder. ~fred/.ssh needs to be owned by fred and chmodded 700, won't work any other way.
4/15/2008 3:16:18 PM
thanks for the reply.fred's folder is 700, and authorized_keys is 600.
4/15/2008 3:18:02 PM
check your sshd config to see what it has set for the default authorized keys file.
4/15/2008 3:19:22 PM
#AuthorizedKeysFile .ssh/authorized_keysit is, obviously, commented out. i tried uncommenting and changed it to:AuthorizedKeysFile %h/.ssh/authorized_keysbut that didn't work either. fwiw, UsePam is set to Yes. I don't know anything about that though.
4/15/2008 3:23:23 PM
if its commented out iirc it should go to the default which is userhome/.ssh/Authorized_Keys as you already know.I think its commented out by default too. I would double check how you're putting it into the authed keys file. If you put the public key into root's authorized_keys file and then try to login with they key as root, does it work?
4/15/2008 3:33:42 PM
do you need the %h?
4/15/2008 3:33:47 PM
^ i've tried it with and without it.^^ i copied the public key into root's authorized_keys file and tried to connect as root. it worked perfectly. so does this mean that there is something wrong with fred's authorized_keys file or does it mean that sshd isn't even looking into it?
4/15/2008 3:43:47 PM
My first guess would be that sshd isn't looking at it for some reasons (either permissions or config). Try matching the permissons with root's .ssh dir and everything inside it
4/15/2008 3:55:18 PM
you are not going to believe what the problem was...original file:
ssh-rsa %mybiglongkey%== comment
ssh-rsa %mybiglongkey%=
4/15/2008 4:04:05 PM