1. Overview
2. Build process
2.1 See if there is a. SSH directory
2.2 Creating the. SSH Directory
2.3 Generating a public key pair
2.4 Generate validation files and modify permissions
2.5 Summary
1. Overview
After the Linux system, the SSHD service will normally be launched to provide remote login.
The user can configure the SSH key login method to be more secure. The administrator can implement the password-free login management of the cluster via SSH key.
So you need to know how to generate a public key pair on Linux.
2. Build process 2.1 See if there is a. SSH directory
Linux systems typically install the SSHD service, but do not necessarily generate configuration directory/root/.ssh. If this directory does not exist, it can be created manually.
2.2 Creating the. SSH Directory
Administrators or users can create this directory manually. Note: the. SSH directory permission is
2.3 Generating a public key pair
Go to the. SSH directory and execute the command
Parameter meaning:
- -t specifies that the encryption algorithm is RSA
- -p Specifies the password for the key is Liwanliang
- -f Specifies the name of the generated key file
2.4 Generate validation files and modify permissions
2.5 Summary
The above procedure is the process of generating a key pair under Linux.
After you write this public key to the/root/.ssh/authorized_keys of any remote host, you can log on to the remote host by using the key.
Any host, after obtaining the key Id_rsa, can log on to the host that is written to the public key id_rsa.pub.
Note: The premise is that each other network interoperability, port open, host does not refuse other network or security configuration.
Linux hosts generate key pairs