Question

Permission denied (publickey) issue

Posted January 24, 2021 408 views
Initial Server SetupDigitalOcean Droplets

I am new to Digital Ocean and I created a droplet using an SSH key with Puttygen.
Now it seems I can’t login from the console as it requires a password to login and none of them works, I’ve tried my SSH key passphrase and the root password that has been e-mailed to me as I used the Reset Password function, and always get the Login Incorrect message.

So I used Putty instead and managed to login but I keep running into Permission Denied (publickey) issues, both as root and as the user I created. If I try to log in (ssh user@serverip), I get permission denied.
I tried uploading a file on my server both as root and user and permission is denied.
I tried to view the authorized keys to grant the necessary permissions as explained on this page (https://www.digitalocean.com/docs/droplets/resources/troubleshooting-ssh/authentication/#fixing-key-permissions-and-ownership) using the /root/.ssh/authorized_key command but I get permission denied here too.

I am not familiar enough with Linux and the system to understand where these authentication issues come from and what I would need to do to fix them and being able to access my server properly. Any help will be warmly appreciated.

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.

×
Submit an Answer
1 answer

Hello, @naith7

Can you confirm if you have multiple ssh keys to access more than one droplet or you’ve created your first ssh-key in order to access this droplet?

Keep in mind that you can use the DigitalOcean console in order to access your droplet and check the file permissions and the content of the /root/.ssh/authorized_key file and make sure your id_rsa.pub key is added to the file as well.

I will recommend you to check the following tutorials:

https://www.digitalocean.com/docs/droplets/how-to/connect-with-ssh/putty/

https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/to-existing-droplet/

Regards,
Alex