Question

ssh-key on already existed droplet

  • Posted December 9, 2014

If I have already created my droplet, how can I add ssh-key to it?

Subscribe
Share

Submit an 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.

@asb you didnt get me buddy, i hire various freelancer time to time for individual work in my server. and i need to give me my password for root access. what should i do in this case? isnt there any way to secure my server by giving them a sort of access by which they cant bring harm if they want?

also, i can add ssh key to my droplet by deploying from snapshot. correct?

This comment has been deleted

You simply need to paste the contents of your public key into the ~/.ssh/authorized_keys file on the server. On a Mac or Linux computer, you can send your key to the server with this one command:

cat ~/.ssh/id_rsa.pub | ssh username@server.ip.addr "mkdir -p ~/.ssh && cat ~/.ssh/authorized_keys"

For all the details, check out this tutorial: