Digital Ocean droplet cannot ssh

Hi can I ask some help, I created account to digital ocean and I created droplet using the default project

After that I immediately adding my ssh key to the ssh key box of my account and it was successfully save.

when I access via ssh terminal

ssh root@i.p-of-the-droplet

It will show Permission denied (publickey).

Can some one help me why is it permission denied. ?

Thank you in advance

Hi jemz,

It’s hard to know what exactly the problem is from the information you have provided, but a good place to start troubleshooting is here:

Hi James,

I already followed that earlier, I tried also set 777 permission to authorized_keys, just to ensure that I can connect the ssh but no luck.

I tried also create user and add permission to it and also permission to authorized_keys

I tried also reboot and adding my public key manually to the authorized_keys still no luck

even the ssh key I pasted to digital ocean is the key that I used to my other server clients
still getting issue permission denied.

What happens if you delete your public key on the DO droplet. Can you then you then connect via SSH using a username & password combo?

Are you sure you put your public and private key in the correct folder (Depending on your OS) where the OS can find it?

I get permission denied even I have no keys added in DO box

Yes I put it here


Are you sure that the server’s IP is correct?

Yes that is what it’s put beside the name of my droplet

I don’t use DO, so password login might be disabled.

I’m not sure how much help I can be other than excluding some obvious errors. However, if you want to list the steps you took and the commands you ran, I’ll see if there is anything else that occurs to me.

Thanks I’ll be back to provide the steps

I fixed now by experimenting. :slight_smile:

Should not use putty key gen to generate the pub and priv key , use the ssh-keygen

then I open the private key using putty keygen and copy manually to the authorized_keys to my droplet, I did not put in the sskey box of DO because it will not work.


1 Like

Glad you got it sorted. I was about to reply that there were too many components that I was unfamiliar with (Putty, Windows, DO), but then saw that you solved the problem.

So, just for my own understanding: the problem was the keys you were generating with Putty. These were somehow incorrect. And you were able to generate the keys correctly using the ssh-keygen command.

Did I get that right?

1 Like

I am pretty sure that putty is not the case.

Yes correct

Well I tried many times and I end up generating using comand ssh-keygen and manually paste to authorized_keys

Ok, got it. As Thallius says, that sounds a bit weird, but if it worked for you, then all good.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.