I manually edited my authorized_keys file and added my ssh public key. However when trying to login using the private key in putty I get a disconnected no supported authentication methods available (server sent publickey) error. I read several threads here but can´t find any way to fix this. Any ideas?
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.
Hello there,
You can check our article on How to Upload an SSH Public Key to an Existing Droplet
You can access the droplet from the DigitalOcean console and then temporary enable the PasswordAuthentication on your droplet and access the droplet with a password to upload the ssh-key.
If you haven’t created new pair of keys you’ll need to do that first.
You can enable PasswordAuthentication for your Droplet by modifying your
/etc/ssh/sshd_config
file. Once set to Yes restart the SSH service and connect via an SSH client for a more stable connection. You can then modify your~/.ssh/authorized_keys
file to add the appropriate public key.This change can be made from the DigitalOcean’s console. If you’re having issues accessing the console you can then reach to our amazing support team that can help you further with this.
To enable the
PasswordAuthentication
follow these steps:sudo nano /etc/ssh/sshd_config
PasswordAuthentication
from “no” to “yes” and save the filesudo nano ~/.ssh/authorized_keys
sudo nano /etc/ssh/sshd_config
PasswordAuthentication
from “yes” to “no” and save the fileYou can then upload the key using this command:
ssh-copy-id -i ~/.ssh/mykey user@droplet
Hope that this helps! Regards, Alex
Hello friend!
The first thing I would do is make sure that your key pair is OpenSSH compatible. For example, this is one of my public keys and yours most likely looks the same:
If all is well there, I would add the verbose flag to your SSH connection (ssh -vvv) and go over each line to see what it is doing. If it loads your private keys without error and moves forward without accepting login, I would suggest one of these is true:
I couldn’t say for sure which configuration had been changed to cause #1, but #2 should be fine if the public key is on a single line in authorized_keys under /root/.ssh or /home/username/.ssh (if not using root). More than likely I’ve already covered the problem area, taking a closer look at each detail should reveal something that you have not yet noticed. SSH login issues tend to not be very complex at their core.
Kind Regards, Jarland