add ssh to aditional computers

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?

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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/ | ssh demo@ "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

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.

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?