Hadoop Learning Notes (v)--Implementation of SSH password-free login in full distribution mode

Source: Internet
Author: User
Tags scp command

1) Set the network configuration of 3 machines and unify the user name, except root

master:192.168.2.10

slave1:192.168.2.11

slave2:192.168.2.12

2) SSH password-free login idea

Since three nodes are accessible to each other, three nodes are both client and server side, we create a pair of key files on three nodes respectively, the key file includes the public key file (~/.ssh/id_rsa.pub) and the private key file (~/.ssh/id_rsa).

When the client logs on to the other node using SSH, SSH sends the private key to match the public key on the other nodes, and if the match succeeds, it will automatically log in without entering the password, which will enable no password login. Therefore, to implement the password-free login to the target node, the client needs to write the public key to the ~/.ssh/authorized_keys on the target node.

3) SSH password-free login implementation mode

On the master that sends all the public keys, by master consolidates the public keys of each client node into ~/.ssh/authorize_keys, and then uses the SCP command to replicate the ~/.ssh/autorized_keys to the other two nodes

4) Check to see if SSH is installed

Ssh–version/ssh-v

5) Client Creation secret key

ssh-keygen-t RSA #用rsa算法产生秘钥

cd. SSH #进入. SSH directory

LS #查看此目录下的文件: Id_rsa id_rsa.pub

In turn, on other clients.

6) Write the master's public key to master

CP Id_rsa.pub Authorized_keys

Modify Permissions #root用户无需修改

SSH Host name #登录验证

7) write the slave public key to master

SLAVE1:SCP id_rsa.pub [email protected]:/home/hadoop/id_rsa_01.pub

Slave2:scpid_rsa.pub

[email protected]:/home/hadoop/id_rsa_02.pub

Cat Id_rsa_01.pub >>~/.ssh/authorized_keys #写入公钥

Cat Id_rsa_02.pub >> ~/.ssh/authorized_keys #写入公钥

8) Copy the master public key into the slave

SLAVE1:SCP Authorized_keys [Email Protected]:~/.ssh/authorized_keys

SLAVE2:SCP Authorized_keys

[Email Protected]:~/.ssh/authorized_keys

9) IP and hostname binding configuration sync to two other slave machines

scp/etc/hosts [Email protected]:/etc/hosts

scp/etc/hosts [Email protected]:/etc/hosts

10) "SSH host name" test with each other

11) Impressions

In order to novelty, I actually installed the centos7.1, the amount of song God, change a bit big, some orders are not the spirit, have to check the whole Linux, so from the efficiency, the framework, system, software what is the mainstream mature version is more appropriate, can refer to more information!

Hadoop Learning Note (v)--Implementation of SSH password-free login in full distribution mode

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.