I am having an issue connecting to my droplet over ssh.
Whenever I try to loging in using ssh. I get and error:
root@xxx.xxx.xxx.30: Permission denied (publickey). I copied my public key to the digital ocean server and then tried to login.
Still I get the same thing.
I tried “ssh —v root@xxx.xxx.xxx.30” and get tons outoutput that I don’t understand.
The only thing I see in the logs that looks suspicious is this:
debug1: Authentications that can continue: publickey debug1: Trying private key: /root/.ssh/id_dsa debug3: no such identity: /root/.ssh/id_dsa: No such file or directory debug1: Trying private key: /root/.ssh/id_ecdsa debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory debug1: Trying private key: /root/.ssh/id_ed25519 debug3: no such identity: /root/.ssh/id_ed25519: No such file or directory debug1: Trying private key: /root/.ssh/id_xmss debug3: no such identity: /root/.ssh/id_xmss: No such file or directory debug2: we did not send a packet, disable method debug1: No more authentication methods to try.
I don’t have the files “/root/.ssh/id_dsa” , but I do have “/root/.ssh/id_rsa”
It seems to me that digital ocean is expecting a dsa style key and I only have a rsa style key???
…
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, @mattreister
Thanks for updating us on what happened.
Regards, Alex
Hi Alex,
Thank you for the reply and thanks for letting me know i cannot add or modify keys on my control panel after my droplet has been created.
I think that is a good idea allowing password authentication… however you mentioned i needed to ssh into my droplet to do this…
But the whole point in my asking this questions is that i cannot ssh into my droplet… if i could ssh into my droplet my problem would already be solved.
I solved my problem by deleting my droplet then creating a new one with my new ssh key in there.
Thanks!
Hello, @mattreister
Could you please make sure that you’ve copied the key stored in
~/.ssh/id_rsa.pub
from your local machine to the authorized file in ~/.ssh/authorized_keys on your droplet?Keep in mind that you can still access the droplet via the console in the control panel.
The server is trying different authentications methods and eventually gives a error: No more authentication methods to try.
Once you’ve copied your key:
Open the
~/.ssh/authorized_keys
file for editing using a terminal-based text editor, like nano.Paste the contents of your SSH key into the file by right-clicking in your terminal and choosing Paste or by using a keyboard shortcut like CTRL+SHIFT+V. Then, save and close the file. In nano, save by pressing CTRL+O and then ENTER, and exit by pressing CTRL+X.
You can check this tutorial as well:
https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/to-existing-droplet/#manually - refer to Manually from the Droplet without Password-Based Access
Let me know how it goes.
Regards, Alex
Hi @mattreister,
It’s trying out different SSH keys until it actually find the one it can use.
You’ll need to add your id_rsa.pub key usually located in
To the file on your droplet :
As soon as you do, you should be able to SSH without a problem to your droplet.
If you are unsure how to actually perform the above tasks, DigitalOcean have a very good tutorial which you can check here - DigitalOcean Tutorial SSH Keys
Regards, KDSys