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

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?

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.

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:


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/ | \
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

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