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

The complete steps of ssh configuration without password login in Linux and what are the problems that should be paid attention to?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

The complete steps of ssh configuration password-free login in Linux and the problems that need to be paid attention to. In view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Preface

For pseudo-distributed and fully distributed Hadoop, the name node (NameNode) of Hadoop needs to start the Hadoop daemon of all machines in the cluster, which can be achieved through SSH login. Hadoop does not provide the form of SSH password login, so in order to log in to each machine smoothly, all machines need to be configured in the form that the name node can log in without a password.

What is SSH

Ssh-secure Shell Protocol

SSH is the abbreviation of Secure Shell and was developed by IETF's Network working Group (Network Working Group). SSH is a security protocol based on the application layer and the transport layer. SSH is currently a reliable protocol designed to provide security for remote login sessions and other network services. The use of SSH protocol can effectively prevent information leakage in the process of remote management. SSH was originally a program on the UNIX system, and then rapidly expanded to other operating platforms. When used correctly, SSH can make up for loopholes in the network. The SSH client is suitable for a variety of platforms. Almost all UNIX platforms, including HP-UX, Linux, AIX, Solaris, Digital, UNIX, Irix, and others, can run SSH.

Second, ssh configuration password-free login step 2.1, principle explanation

First we generate a pair of SSHKey: SSH keys and SSH public keys on our Linux system. Then upload the public key to the Linux server, and then we can log in with SSH without a password.

For pseudo-distributed and fully distributed Hadoop, the name node (NameNode) of Hadoop needs to start the Hadoop daemon of all machines in the cluster, which can be achieved through SSH login. Hadoop does not provide the form of SSH password login, so in order to log in to each machine smoothly, all machines need to be configured in the form that the name node can log in without a password.

Generate SSH keys and public keys on your own Linux system

Before the installation of ssh is completed but not configured (you can refer to big data for basic learning 4: the complete steps of the installation process of pseudo-distributed Hadoop on Ubuntu, the analysis of error prone points and the problems needing attention (take ubuntu-18.04.3 and hadoop-3.2.1-tar.gz as examples).

The Linux terminal will be prompted to enter the password when you enter ssh localhost, and then log in successfully. But to log in this way, you need to enter a password, which is why we configure login without a password.

First exit the ssh, go back to our original terminal window, and then use ssh-keygen to generate the key and add the key to the authorization:

Exit# exits the previous ssh localhostcd ~ / .ssh / # if there is no such directory, please execute ssh localhostssh-keygen-t rsa # again. Press enter to cat. / id_rsa.pub > >. / authorized_keys # to join the authorization.

Description:

Use ssh-keygen to generate RSA keys and public keys, and-t stands for type, which is the key to generating RSA encryption.

RSA is also the default encryption type, so you can only enter ssh-keygen, the default RSA length is 2048 bits, if you are very security-conscious, then you can specify a length of 4096 bits.

Ssh-keygen-b 4096-t rsa

The SSH key is saved in the .ssh / id_rsa file in the home directory, and the SSH public key is saved in the .ssh / id_rsa.pub file.

On Linux systems, ~ represents the user's home folder, the directory "/ home/ username".

Generating public/private rsa key pair.Enter file in which to save the key (/ home/matrix/.ssh/id_rsa): # Press enter key Enter passphrase (empty for no passphrase): # enter a password Enter same passphrase again: # enter the password Your identification has again Been saved in / home/matrix/.ssh/id_rsa.Your public key has been saved in / home/matrix/.ssh/id_rsa.pub.The key fingerprint is:e1:dc:ab:ae:b6:19:b0:19:74:d5:fe:57:3f:32:b4:d0 matrix@vividThe key's randomart image is:+--- [RSA 4096]-+ |.. | |. . | |. . .. . | |. . O o.. E. | | o S.. o... | | =.. +. | | o. . .o. | | .o. | |. + o | +-+ 3. Login verification. |

After the execution is completed, use the ssh localhost command to log in directly without a password (you need to enter the encrypted password of the SSH key when you log in with SSH Key for the first time, and you will log in automatically in the future, and you no longer need to enter the password of the key), as shown below:

This is the answer to the complete steps of configuring ssh without password in Linux and the questions that need to be paid attention to. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

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

Internet Technology

Wechat

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

12
Report