Two Linux machines log on to each other using ssh without A password. assume that user user1. On HostA, run ssh-keygen to generate the private key id_rsa and public key id_rsa.pub as user1, and then run the command ssh-copy-iduser1 @ HostB to copy the public key to HostB, enter the user1 password on the HostB, and then log on to the HostBssh with no password
Two Linux machines log on to each other using ssh without A password. assume that user1.
Run the command in user1 on Host.
ssh-keygen
Generate the private key id_rsa and public key id_rsa.pub, and then execute the command
ssh-copy-id user1@HostB
Copy the public key to Host B, and enter the user1 password on Host B, then Host A and Host B ssh password-free login
Scp the private key on Host A to Host B
scp ~/.ssh/id_rsa user1@HostB:~/.ssh/
Change the public key id_rsa.pub on Host A to authorized_keys.
mv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
At this point, the password-free logon from Host B to Host A ssh is also required.