Login-free SSH configuration for Linux multiple hosts

Source: Internet
Author: User
Tags free ssh

1. First check if SSH is installed

Rpm-qa | grep ssh

If yum install SSH is not installed

2. Perform on each machine

ssh-keygen-t RSA generates two files in root/.ssh/. (The root account is used at this time, and the different accounts are not generated in the same location.) Never tried! Copy one of the files generated on each machine.

CP ~/.ssh/id_rsa.pub ~/.SSH/ID_RSA.PUB.100

Send them all on a machine

Scp-r ~/.ssh/id_rsa.pub.101 [Email protected]:/root/hadoop/.ssh

Now it's all on the 100 machine.

3. Put all the machine's public key into a file

Cat ~/.ssh/id_rsa.pub.100 >> ~/.ssh/authorized_keys
Cat ~/.ssh/id_rsa.pub.101 >> ~/.ssh/authorized_keys
Cat ~/.ssh/id_rsa.pub.102 >> ~/.ssh/authorized_keys

4. The authority of the document is amended to

chmod 644 Authorized_keys

5. Copy the generated Authorized_keys files to another machine

Scp-r ~/.ssh/authorized_keys [Email protected]:/root/hadoop/.ssh

Repeat step 4. Now all the machines are free to sign in with each other!

Login-free SSH configuration for Linux multiple hosts

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.