Report this

What is the reason for this report?

How can I add a new SSH to my server?

Posted on February 27, 2020
jouo

By jouo

I’m new to this, when I created my DigitalOcean “project” it allowed me to enter an SSH key, it works great!

Now I want to add an SSH key for another computer, but I don’t see an option anywhere for that :(



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.
0

Hello, @jouo

You can follow out tutorial in order to generate a new ssh-key locally on your computer or any other PC and then upload it to your droplet:

https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

  1. You need to generate the key using the ssh keygen command:
ssh-keygen -t rsa
  1. Once this is done you can simply copy the id_rsa.pub key file to the authorized_keys file on your droplet using this command:
cat ~/.ssh/id_rsa.pub | ssh demo@IPaddress "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >>  ~/.ssh/authorized_keys"

Hope 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.