Report this

What is the reason for this report?

Can't login with SSH key when creating new droplet, but works if I clone...

Posted on October 14, 2020

I created a new droplet, assigned the same key I always use, put the new IP in my SSH software and used the same key I always use, and it says “Server refused our key”.

I tried that multiple times, creating both blank droplets, and creating them from apps in the marketplace.

If I do the same thing but create the server from a snapshot of one I know works, choose the same key when setting up, and put that IP in, it works just fine.

What am I doing wrong?



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!

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.

whatever, I just made a new key and it seems fine

Hello, @skeddtemp

If you ever face the issue again you can quickly use the console in your DigitalOcean account and access your droplet and check if the ssh-key is present on your droplet.

You can make sure that the key is added in:

 ~/.ssh/authorized_keys

If the key is not there you can try adding it via the console or temporary enable the PasswordAuthentication and ssh to the droplet via password and copy the key using this command:

cat ~/.ssh/id_rsa.pub | \
ssh username@IPaddress "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Note: Please change IPaddress with the actual IP address of your droplet.

Hope that this helps! Regards, Alex

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.