Welcome to the Linux Foundation Forum!

Exercise 5.5: Parallel ssh command execution


In the solution step 2 you have the following text:

  1. Setup ssh keys and fingerprints If not already done, create a key pair on the local machine
    $ ssh-keygen
    Copy the key to the remote and save the fingerprint
    $ ssh-copy-id localhost

I don't understand why in the command the host is 'localhost' although in the text above is mentioned "copy the key to the remote...". Please explain why is that?


  • lee42x
    lee42x Posts: 380

    Thank you for the input.

    In this class we assume you have only one system that you are working with so the term "remote" is perhaps not accurate. In step 2 we create the keys and distribute them to the only host we know you have, "localhost" . The same command would apply if you had several other remote systems that you wanted to use.
    In step 3 we test for password-less ssh login to the available "remotes" (the DHCP address, and localhost). All these "remotes " are the same machine but "pssh" doesn't know that and we see in step 5 all three "remotes" responding.

    I hope this helps.

    We will clarify this in the next edition of the class.

    Thanks Lee


Upcoming Training