Linux configuration ssh password-free login (necessary for big data service construction)

Linux configuration ssh password-free login (necessary for big data service construction)

foreword

Usually when we build big data-related clusters, a necessary step is to configure SSH password-free login. For example, when we build a Hadoop cluster, the machines in the cluster need to trust each other. If SSH password-free login is not configured, we need to manually enter the password of the machine when starting the Hadoop cluster. If the number of cluster instances Less is acceptable, but when there are many cluster instances, it is conceivable that you need to enter the password over and over again.

start configuration

The configuration work is very simple. First, use the following command to generate the ssh key: ssh-keygen
press Enter several times in succession, and it will appear as shown in the figure below: insert image description here
Then we use ssh-copy-id 需要连接主机的用户名@需要连接主机的ip地址, such as: ssh-copy-id [email protected], after pressing Enter, enter a "yes" and press Enter Enter the password required to connect to the host to complete the password-free login configuration. As shown in the example below:
insert image description here

Conduct password-free login test

Use the command: ssh 需要连接主机的用户名@需要连接主机的ip地址, for example ssh [email protected], if it is the first connection, you need to enter "yes" again, and then you can directly log in successfully after disconnecting and reconnecting.insert image description here

Guess you like

Origin blog.csdn.net/wFitting/article/details/106521316