Server refused public-key signature despite accepting key

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?



I installed the LEMP package.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.