Skip to main content

Ssh - Disable root login with ssh keys

Comments

6 comments

  • dalem
    Do you have KVM access so you can edit your sshd_config and enable passwords temporarily
    0
  • cashgold
    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
  • dalem
    su username ssh-keygen -t dsa
    0
  • cPanelMichael
    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
  • cashgold
    Solved applying dalem suggestion and duplicating the newly created key file in /home/newuser/.ssh and renaming it to authorized_keys
    0
  • Sys Admin
    [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.