Different SSH key for different client user accounts

May 6, 2018 602 views
Security CentOS

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?


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.

Have another answer? Share your knowledge.