Add ssh key into existing droplet

July 26, 2014 33.5k views

How do I add an SSH key into an existing droplet? I created two keys, added into my ssh keys on the panel but my droplets still ask for a password (the keys have no password). Thanks!

4 Answers

Copy the contents of the public key into (create if it doesn’t exist) /home/(user)/.ssh/authorized_keys or /root/.ssh/authorized_keys if you login as root.

you get it? i think this may help

by Pablo Carranza
This tutorial runs through creating SSH keys with PuTTY to connect to your virtual server.

ssh-copy-id -i “/root/.ssh/idrsa” root@dropletipgoeshere

I got it to work by adding the ssh key to both /root/.ssh/authorized_keys and /root/.ssh known_hosts then restarting the droplet

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!