Wednesday, January 26, 2011

Can i use authorized keys for user not 'root'

I used this tutorial to login into root without using password. Is there any way to make this work for normal user , not root user

  • sure. you can put your own key into ~/.ssh/authorized_keys

    Master : when i tried using 'normaluser' then it says that i don't have "~/.ssh/authorized_keys" this file. so you mean first i have to create the folder .ssh and then file called authorized_keys and then insert key in there
    solefald : yep. if you never ssh'd as 'normaluser' **from** that server, you do not have `~/.ssh`, so you will have to create it. `authorized_keys` is usually created by the user himself,so you have to create it too :). There are cases when it is created automatically when user is added, but not without someone setting that up in `/etc/skel` first.
    jrod : Be sure to `chmod 700 ~/.ssh` and `chmod 600 ~/.ssh/authorized_keys` or else sshd will refuse to check them, due to insecure permissions
    solefald : @jrod: i beg to differ. my `~/.ssh` is `755` and `~/.ssh/authorized_keys` is `644`. works fine.
    jrod : Whoops, looks like I got it backwards. It's the keys themselves that need secure permissions. (`~/.ssh/id_rsa`)
    Master : thanks buddies , it worked
    From solefald

0 comments:

Post a Comment