Establishing SSH equivalence between two hosts – no passphrase required

Note: I did this with and without a privileged account on RHEL 7.4 both types with Selinux in permissive mode.

// make sure the .ssh directory exists on both sides
cd
mkdir .ssh
chmod 700 .ssh
// generate the auth key - the default authentication key is an: RSA key for use in SSH protocol 2 connections
ssh-keygen 
// - copy the authorized_keys file with public keys on target side
ssh-copy-id user@target  // before you issue this command make sure the .ssh directory exists on both sides
#test by doing:
ssh user@target // should be able to login with no password

if you want to do passwordless ssh in both directions – then repeat steps above on the other host

Troubleshooting:

If any node prompts for a password, verify that the ~/.ssh/authorized_keys file on that node contains the correct public keys (matches id_rsa.pub on the otherside), and that you have created a User Account with identical group membership and IDs on all nodes that you want to establish SSH equivalence on.

Leave a Comment

Scroll to Top