Ssh - Disable root login with ssh keys
Hi,
I've disabled ssh access with password preferring doing it with ssh keys.
Now I want to disable ssh root access and add a new user to whell group.
I've created the new user via cli more than cpanel web interface, so I don't have to put fake information like domain and so on.
I've added the new user to the wheel group but at this point I'm stucked. I cannot ssh login with the new user because the server require an ssh key. From cpanel WHM I can generate ssh keys only for root, and from cpanel account administration panel (port 2083) I cannot access the user specific one because I created it via cli.
Thanks
-
Do you have KVM access so you can edit your sshd_config and enable passwords temporarily 0 -
I can access the ssh, I've not still disabled root login. Just want to know how to allow non-root user to access ssh with an ssh-key (not password) After being successfully I'll disable root login. I can create ssh key for non-root user through cpanel, but only if I create a cpanel account (with domain and additional infos) I'm wondering how to create ssh keys for user created through cli (command adduser) Thanks 0 -
su username ssh-keygen -t dsa 0 -
Hello :) Yes, simply access SSH as the user using the account password and then generate a key with the instructions from the last post. Thank you. 0 -
Solved applying dalem suggestion and duplicating the newly created key file in /home/newuser/.ssh and renaming it to authorized_keys 0 -
[quote="cashgold, post: 1604691">Solved applying dalem suggestion and duplicating the newly created key file in /home/newuser/.ssh and renaming it to authorized_keys
Make sure to generate new keys (public & private) for each new user for security reasons.0
Please sign in to leave a comment.
Comments
6 comments