add ssh to aditional computers

October 26, 2019 128 views
Networking

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?

2 Answers

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?

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.

  • Yes, you can put many keys in the authorized_keys file, all you need is the public key from whatever host (or private/public key pair) to which you want to grant access. If you’re connecting from a Linux system, then you can find it like this:

    $ less ~/.ssh/id_rsa.pub

    That’s the default location of the ssh public key for the user account to which you logged in. Copy the contents of that file, then add that as a new line in the authorized_keys file on your droplet.

    On other OSes (including mobile OSes by the way) the public key will be in a different place, or you may not even be able to access it directly. Check the documentation for the SSH client you’re using for how to locate the public key for those systems.

Have another answer? Share your knowledge.