Question

How can I add a new SSH to my server?

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 :(

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.

Accepted Answer

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