Question

Cannot login to droplet using ssh

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???


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.

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:

ssh-rsa EXAMPLEzaC1yc2EAAAADAQABAAACAQCqql6MzstZYh1TmWWv11q5O3pISj2ZFl9HgH1JLknLLx44+tXfJ7mIrKNxOOwxIxvcBF8PXSYvobFYEZjGIVCEAjrUzLiIxbyCoxVyle7Q+bqgZ8SeeM8wzytsY+dVGcBxF6N4JS+zVk5eMcV385gG3Y6ON3EG112n6d+SMXY0OEBIcO6x+PnUSGHrSgpBgX7Ks1r7xqFa7heJLLt2wWwkARptX7udSq05paBhcpB0pHtA1Rfz3K2B+ZVIpSDfki9UVKzT8JUmwW6NNzSgxUfQHGwnW7kj4jp4AT0VZk3ADw497M2G/12N0PPB5CnhHf7ovgy6nL1ikrygTKRFmNZISvAcywB9GVqNAVE+ZHDSCuURNsAInVzgYo9xgJDW8wUw2o8U77+xiFxgI5QSZX3Iq7YLMgeksaO4rBJEa54k8m5wEiEE1nUhLuJ0X/vh2xPff6SQ1BL/zkOhvJCACK6Vb15mDOeCSq54Cr7kvS46itMosi/uS66+PujOO+xt/2FWYepz6ZlN70bRly57Q06J+ZJoc9FfBCbCyYH7U/ASsmY095ywPsBo1XQ9PqhnN1/YOorJ068foQDNVpm146mUpILVxmq41Cj55YKHEazXGsdBIbXWhcrRf4G2fJLRcGUr9q8/lERo9oxRm5JFX6TCmj6kmiFqv+Ow9gI0x8GvaQ== username@203.0.113.0

Open the ~/.ssh/authorized_keys file for editing using a terminal-based text editor, like nano.

nano ~/.ssh/authorized_keys

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