I created a user with root privileges, but when I try to log in as root, I get the following error: Server refused public-key signature accepting despite key. And the server asked me for a password, but I have no password because I should access through ssh key.
But if I go to the server with the user I created with root privileges, it works well with ssh keys. I use the same key for both root ssh to the new user. I generated the key with PuTTYgen.
I use Nginx.
How can I solve that?
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.
Since you appear to have a user you can access, look at the actual error in /var/log/auth.log
.
Assuming a default install, if you can’t log in via SSH pubkey authentication, it’s generally because of a lacking ~/.ssh/authorized_keys
file, the wrong key being set in that file, or bad permissions on that file or its containing directory. Giving the wrong key from your client can also lead to issues.
On the client side, you can use ssh -vv
(or find a way in Putty to enable additional logging) to verify what’s going on.
I installed the LEMP package.