Configure ssh password-free login and ssh password login
Take the root account as an example to prepare more than two Linux servers. Here I use s204 and s205. multiple servers use ssh to log on to the server first, if ssh s205 is not installed, the system will prompt you to enter the password principle: encrypt data with your local private key, and other hosts will use your public key to decrypt your data. Verify that SSH is installed on the system. Rpm-qa | grep opensshrpm-qa | grep rsync. If ssh and rsync are not installed, run the following command to install rsync. Yum install ssh --> install the SSH protocol yum install rsync --> rsync is a remote data synchronization tool, you can use LAN/WAN to quickly synchronize files between multiple hosts. service sshd restart --> Start service 1. generate ssh-keygen-t rsa. in the ssh directory, id_rsa and id_rsa.pub pairs of private keys and public keys are generated. Execute the same command on other servers to generate a file. merge the public keys on all servers into a file authorized_keys. ssh root @ s205 cat/root /. ssh/id_rsa.pub> authorized_keys 3. view the public key information of multiple servers in authorized_keys. If you have multiple servers, add them to the server. copy authorized_keys and known_hosts to another server. scp authorized_keys root @ s205:/root /. ssh/scp known_hosts root @ s205:/root /. ssh/Note: The authorized_keys permission must be granted to 600 chmod 600 authorized_keys.