Report this

What is the reason for this report?

Impossible to add ssh key to existing droplet

Posted on November 8, 2016

HOW do I add a ssh key from a NEW laptop to an existing droplet. I’ve added via the admin panel my ssh public key and when restarting the droplet it’s not added. I’ve tried “ssh root@myip” and typing in the root password I set, I get permission denied. I’ve tried resetting the droplet password and “ssh root@myip” withthe newly sent password, I stil get permission denied. The console via the do website can get me logged in but it lacks copy paste so I cannot paste in the ssh key via that.

Running Ubuntu 14.04 both droplet and my computer.

HOW do I get my ssh key into the droplet?



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.

When I do:

sudo service ssh restart

I get:

Redirecting to /bin/systemctl restart ssh.service
Failed to restart ssh.service: Unit not found.

Any ideas?

Is this not a HUGE security hole? I’ve been using DO for years now and just now realized that deleting keys from the UI interface does not remove the keys from authorized_keys. It appears brutally obvious right now, but I was under the impression that by removing the key from the UI I was removing the user’s access. So, I’ve had old users in my authorized_keys file. Yikes!!

This worked for me too, thanks! One thing I would add is that if you are on Windows 10, you can go to the MS store, install the Ubuntu shell, and run the “ssh-copy-id” command there. That is what I did.

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.