Help with ssh to multiple computers

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
User avatar
pfd27
Level 2
Level 2
Posts: 90
Joined: Sun Feb 15, 2015 11:13 am

Help with ssh to multiple computers

Post by pfd27 » Tue Jan 24, 2017 10:34 pm

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?

blockhead47
Level 2
Level 2
Posts: 86
Joined: Wed Jun 15, 2016 4:50 pm
Location: Chicago, IL, USA

Re: Help with ssh to multiple computers

Post by blockhead47 » Wed Jan 25, 2017 4:34 pm

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.

User avatar
pfd27
Level 2
Level 2
Posts: 90
Joined: Sun Feb 15, 2015 11:13 am

Re: Help with ssh to multiple computers

Post by pfd27 » Wed Jan 25, 2017 10:06 pm

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

Post Reply

Return to “Other networking topics”