Portal Home > Knowledgebase > Articles Database > disabling SSH root access but enabling SSH keys how to do that?


disabling SSH root access but enabling SSH keys how to do that?




Posted by sharmaine1111, 04-03-2009, 12:02 AM
hello in order to secure my server against instrusion, i disabled ssh root login and created a user for myself. however in order to access the user i need to enable SSH Password authentication I dont enable password authentication all the time and i keep it disabled unless i need to do something via ssh. Now my question will be, is there a way to keep the user i created and keep the root login disabled and password authentication disabled but use ssh keys for the user i created? I was informed that if i opt to login to ssh via the user i created, the only way to do that is to enable password authentication as it cannot work with ssh keys. is this true? I really hope someone can help me how to use the user i created together with ssh keys so i dont have to enable password authentication when loggin to ssh

Posted by Deem3n®, 04-03-2009, 05:11 AM
Try the following option in sshd_config when using keys: ChallengeResponseAuthentication no

Posted by sharmaine1111, 04-03-2009, 08:57 PM
Thank you very much for responding!! may i know what this parameter is doing other than potentially solving my problem? again thank you

Posted by harimau, 04-03-2009, 09:02 PM
to disable password authentication: change no to PasswordAuthentication on your server sshd config

Posted by sharmaine1111, 04-03-2009, 09:04 PM
I know how to disable password authentication. My problem is i created a new user and disabled root login. for me to login to that user, i always need to enable password authentication. I do not want that. I want that i can log in to the user i created (the user has no root access and i only use su command to go to root) without enabling password authentication and instead use keys I hope its now clear. thank you

Posted by SSSlippy, 04-03-2009, 11:01 PM
http://unixwiz.net/techtips/putty-openssh.html#keypair Your key should still have a password on it.

Posted by sharmaine1111, 04-03-2009, 11:09 PM
Yep keys should have passwords but my problem is i disabled root login. im not sure if ssh keys will work with root login disabled.

Posted by Scott.Mc, 04-03-2009, 11:26 PM
You can set it so you can only use root with an ssh key using permitrootlogin without-password



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
HostAVps Down ? (Views: 725)
MySQL Database Issues (Views: 611)

Language: