Report this

What is the reason for this report?

add ssh to aditional computers

Posted on October 26, 2019

I went through setting up ssh with keys, and everything works with keys and passphrase.

How do I make it work on another client computer. Do I just copy some files or generate another keys on the to other laptop computers I have?



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.

Are you trying to set up SSH access from another computer to your Droplet, or are you trying to use the SSH key you created to access a different Droplet or server?

Hello, @stevehendo34

You can use the same steps in order to add the client’s public key in the authorized_keys file on the server. As already mentioned this file can store multiple keys.

You can add the keys using the following command:

cat ~/.ssh/id_rsa.pub | ssh demo@198.51.100.0 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >>  ~/.ssh/authorized_keys"

This can be executed from the client’s machine using their user (chaging the demo in the example with their respective user)

You can also check the whole tutorial we have for the ssh keys

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

Hope this helps!

Regards, Alex

Setup ssh from another computer to access same droplet.

I figured out if I copied files from .ssh from old client to new client computer the login with keys works. I was wondering if a server/droplet can be accesed by more than one key pair. I asumed if so the server would have to have 2 entries in authorized_keys, but I don’t know if this is possible or how to add a second one.

I didn’t really want the same key pairs on two client computers. I want to authorize more than one key pair to ssh to droplet, incase I lose or have my laptop stolen.

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.