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

  • Posted on December 16, 2013
  • njohnAsked by njohn

Disconnected: No supported authentication methods available (server sent: publickey)

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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!

Hello all,

No supported authentication methods available (server sent: publickey), it basically says that the server said it supported public key authentication only and PuTTY was not able to provide it. I will recommend you double-check the settings in PuTYY. You can check these tutorials:

You can try copying the key via ssh instead of using PuTTY. You can also use the ssh-copy-id command in order to do so. An example will be:

  1. ssh-copy-id -i ~/.ssh/mykey user@host

You can also temporary enable the PasswordAuthentication from no to yes in order to access your droplet using password and then once you’ve entered your key to disable the PasswordAuthentication again. This way is considered more secure than uploading the key to a Dropbox in case you don’t have any other server to us.

  1. Log in to the console on the DigitalOcean website.
  2. Type sudo nano /etc/ssh/sshd_config
  3. Change PasswordAuthentication from “no” to “yes” and save the file
  4. Open a terminal on your computer and type ssh username@[hostname or IP address] or if on a Windows box use PuTTY for password login making sure authentication parameters aren’t pointing to a private key
  5. Login with a password
  6. Type sudo nano ~/.ssh/authorized_keys
  7. Paste public key text here and save the file
  8. Type sudo nano /etc/ssh/sshd_config
  9. Change PasswordAuthentication from “yes” to “no” and save the file
  10. Log out and attempt to log back in (if using PuTTY make sure you set up auth parameters to point to your private key)

Hope that this helps! Regards, Alex

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.