Page 1 of 1

Help with ssh to multiple computers

Posted: Tue Jan 24, 2017 10:34 pm
by pfd27
I have two desktops and one laptop. Both the laptop and desktop #1 are running Mint 18.1
Desktop #2 runs ubuntu server. I want to ssh into both desktop with no passwords. Set up
keys on desktop 2 and was working fine when logging in from the laptop. The next night I set up desktop 1
the same way as I did with desktop 2. Works fine on desktop 1 but not 2 now.
I'm thinking I overwrote a key or something.
How do I get it to work with all three computers?

Re: Help with ssh to multiple computers

Posted: Wed Jan 25, 2017 4:34 pm
by blockhead47
In general, you want to place the public keys from the Laptop (those files in the .ssh directory of your home directory that end in .pub) into the
authorized_keys file in the .ssh directory in the home directory of desktop #1 and #2.

If all three of these are in a private LAN you could copy the public keys on the laptop into its own authorized_keys file and then just
copy the .ssh directory to the other 2 PCs. I would not say that is not the most secure thing to do, depending on who has access to the account you are using,
but it is a simple solution.

Also note that ssh is very strict about the permissions on the .ssh directory (perms should be 700) and the private and public keys inside
the .ssh directory. Start all the files in .ssh with perms of 600.

Re: Help with ssh to multiple computers

Posted: Wed Jan 25, 2017 10:06 pm
by pfd27
Thanks for the reply.

I got it working. I had run keygen again while setting up the second computer instead of just uploading the same keys to both boxes.
All good now