Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure SSH password-free login

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to SSH password-free login configuration, concise and easy to understand, absolutely can make your eyes shine, through the detailed introduction of this article I hope you can gain something.

To deploy hadoop cluster, you need to configure SSH password-free login. Why do you want to set SSH password-free login? The reason is that we need to enter yes and root password many times when opening hadoop. This is something we can't stand. We urgently need to implement the login-free function.

Here, three nodes node0, node1 and node2 are configured as an example.

First, the/etc/hosts file for each node should be configured as follows:

10.10.75.100 node0

10.10.75.101 node1

10.10.75.102 node2

2. At each node:

ssh-keygen -t rsa

generate a public key

Note: If it has been generated before, it can be deleted first. The delete command is rm -rf /root/.ssh/

3. Renaming the public key generated by node1 and node2 and copying it to node0

#Node1

cp /root/.ssh/id_rsa.pub /root/.ssh/key_node1

scp /root/.ssh/key_node1 root@node0:/root/.ssh/

#Node2

cp /root/.ssh/id_rsa.pub /root/.ssh/key_node2

scp /root/.ssh/key_node2 root@node0:/root/.ssh/

4. Node 0 generates public key and renames it

cp /root/.ssh/id_rsa.pub /root/.ssh/key_node0

5. On node0, import the public key into the authentication file and execute the following command:

cd /root/.ssh/

cat key_node0 >> authorized_keys

cat key_node1 >> authorized_keys

cat key_node2 >> authorized_keys

cat key_node3 >> authorized_keys

chmod 700 /root/.ssh

chmod 600 authorized_keys

Distribute the authorized_kesy file to other nodes

scp authorized_keys root@node1:/root/.ssh

scp authorized_keys root@node2:/root/.ssh

Test SSH password-free login

This is how to configure SSH password-free login. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report