Configure ssh password-free login and ssh password login

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.