How can I add a new SSH to my server?

Posted February 27, 2020 544 views

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

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.

Submit an Answer
1 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:–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 key file to the authorizedkeys file on your droplet using this command:
cat ~/.ssh/ | ssh demo@IPaddress "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >>  ~/.ssh/authorized_keys"

Hope this helps!