Question

Different SSH key for different client user accounts

Posted May 6, 2018 1.1k views
CentOSSecurity

I have a droplet. And I am using CentOS Web Panel Pro edition also.

I was able to create and use SSH key for root user to login through SSH.

But how can I create and allow others users that I created to access SSH using keys.

Suppose I created a new user “jack”. Now how can I give make it access SSH using Key.

I created a .ssh folder inside “/home/jack/.ssh” and copied the “authorized_key” file. I updated the public key in this file from the one I generated using puTTy for this new user.

Now when I try to access the SSH using the corresponding private key, I get an error message in SSH console as below:

Using username “jack”.
Server refused our key

Can someone help me in this?

Thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

The first thing I would check is the ownership and permissions on /home/jack/.ssh to ensure that they are set up in the same way as those in /root/ but with ownership given to the jack account.

Try connecting to the new account with ssh -v jack@[ip_address] This will provide much more verbose output and may provide some additional details to help you troubleshoot.

Submit an Answer