3. CentOS communicates with each other via ssh without password

(1) First configure ssh passwordless login to
ssh-keygen -t rsa on the three machines to
generate the public key of the machine, and then press Enter repeatedly during the process. The ssh-keygen command will put the public key by default
cd /root/.ssh
cp id_rsa.pub authorized_keys in the /root/.ssh directory,
copy the public key to the authorized_keys file, and then use ssh to connect to the machine without entering a password

(2) Then configure ssh password
- free login between the three machines. Use the ssh-copy-id -i hostname command to copy the machine's public key to the authorized_keys file of the specified machine

Guess you like

Origin www.cnblogs.com/hg-super-man/p/12716172.html