SSH – Permission Denied for Non-Root User

centoslinuxssh

I have my digitalocean droplets setup so I can login to ssh via keyfiles. This works fine for the root account but if I create a secondary account via useradd, the only way I'm able to get into the account is via su. If I try to login with ssh using the same keyfile, I get:

Permission denied (publickey,gssapi-keyex,gssapi-with-mic) 

even though I added my public key to /home/user/.ssh/authorized_keys. What to do?

This is a CentOS 7 server.

Note: I also tried adding AllowUsers exampleuser root to /etc/ssh/sshd_config.

Best Answer

Be sure to restart sshd after you've made changes to /etc/ssh/sshd_config.

Related Topic