SSH no password hand set

Source: Internet
Author: User

SSH no password hand set

As a result of many online configuration without password login is very bad use, I simply write a put up a total of the reference, I have prepared 3 test machines, the demand is that these three machines can not use the password to access each other.

Steps as follows: Www.pcjsh.com

Java code

192.168.100.67 Master

192.168.100.68 slave1

192.168.100.69 Slave2

Enter master (Hadoop user)

Perform:

SSH-KEYGEN-T RSA

Enter ~/.ssh Directory

The generated Id_rsa id_rsa.pub

CP Id_rsa.pub Authorized_keys

And then confirm that Authorized_keys's permission is 600 if it's not chmod id_rsa the rest is 644.

Then SSH master Date test

Enter slave1 (Hadoop user)

Enter ~/.ssh Directory

ssh-keygen-t RSA on Master

Put it in the directory

chmod Id_rsa

Then SSH slave1 Date test

and master and slave1 test each other.

Slave2 and Slave1

In fact, CP Id_rsa.pub Authorized_keys does not matter, it is best to use cat command, I This is a map of the trouble, and I am too lazy to skillfully SCP so troublesome point, in fact this is very easy to understand that 3 machines use the same private key, so the public key to generate a set of enough

Of course, the permissions of the three-machine ~/.ssh directory and the following files must be identical, if not different.

I generally for the sake of convenience, three machines are running the ssh-keygen-t RSA command, and then a machine generated key pairs cover the rear two machines, and chmod into the same permissions, that is Id_rsa id_rsa.pub 644 Authorized_keys 644.

Because of the same key, so you can connect yourself can be successfully connected to other machines, if not connected to see if the/etc/hosts file is not configured.

Note : More wonderful tutorials Please pay attention to the triple computer tutorial section, triple Computer group: 189034526 welcome you to join

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.