Automatic login between two Raspberry Pi hosts

If you have multiple Raspberry’s or even multiple Unix hosts , you will start to get frustrated at constantly having to enter a password every time you copy files between them or access these devices from another Unix host.


There is an easy way to disable this with RSA key pairs.

  1. On each host, enter ssh-keygen
  2. Hit enter to keep the default directory.
  3. Passphrase.  Leave blank and hit enter
  4. Your keys are created under .ssh/

Now you need to copy over your key to all the other hosts with;
ssh-copy-id -i .ssh/id_rsa.pub username@serverip



Once this is done, you should now be able to copy files or access each device without having to use passwords.

You still need to enter a password when trying to connect from a host that hasn’t got a key.



[wp_ad_camp_1]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.