Getting an error while I try to ssh into the droplet.

Posted December 16, 2013 12k views
Disconnected: No supported authentication methods available (server sent: publickey)

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
6 answers

For anyone else having as much trouble as I did getting this to work…

First, you need to have the contents of your public key listed in a file called authorized_keys (~/.ssh/authorized_keys). I deleted the public key listed in the Settings>Security page of the DO dashboard. This allowed me to use my password when connecting to the server. Then I could edit the authorized_keys file. You have to edit the file as the user that will being using that key - not as root.

Second, you need to make sure the corresponding private key is on your local machine and your local machine knows where it is. I’m using Windows and PuTTY so I add the private key to the PuTTY session AND make sure that Pageant.exe knows about it. (Google:Pageant add key).

TIP: When you make changes in PuTTY, like changing keys and such, if you don’t save the session it will not remember those changes when it opens again.

Hope this helps!

edited by kamaln7
Did you add your SSH key to your droplet *and* configure putty to use it?
by Pablo Carranza
This tutorial runs through creating SSH keys with PuTTY to connect to your virtual server.

I have the same problem, how to solve? Via console anything i type asks for password, i’m locked.

I also have the same problem, added the key during droplet creation, now I can’t login. What shall I do?

In fact im facing the same issue, i remove the # from PasswordAuthentication yes and also restarted the server using sudo service ssh restart command. still im getting the same error as “Putty fatal error: No supported authentication methods available (server sent: public key)”.

I have reset my root password and renew new password from console. im trying to log in using putty via ip address and port as 22. its throwing same error again and again.

Is there any problem with username as ‘root’ or existing ssh key?

I delete existing ssh key as well from setting-security page, try again still the same error.