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.
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 theauthorized_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:
https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/create-with-putty/
https://www.digitalocean.com/community/tutorials/how-to-create-ssh-keys-with-putty-to-connect-to-a-vps
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:
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.
/etc/ssh/sshd_config
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~/.ssh/authorized_keys
/etc/ssh/sshd_config
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.
I also have the same problem, added the key during droplet creation, now I can’t login. What shall I do?
I have the same problem, how to solve? Via console anything i type asks for password, i’m locked.
Check out <a href=“https://www.digitalocean.com/community/articles/how-to-create-ssh-keys-with-putty-to-connect-to-a-vps”>How To Create SSH Keys with PuTTY to Connect to a VPS</a>.
Did you add your SSH key to your droplet and configure putty to use it?