The method of using the certificate can solve the problem that SSH does not need to enter password.
This article uses the CentOS operating system, creates the SSH key, and realizes the trust between two or more machines. So that SSH login does not require the ability to enter a password.
First, create an SSH Key on a single machine:
[Email protected] ~]# Ssh-keygen
Generating public/private RSA key pair.
Enter file in which to save the key (/ROOT/.SSH/ID_RSA):
Created directory '/root/.ssh '.
Enter passphrase (empty for no passphrase):
Enter same Passphrase again:
Your identification has been saved In/root/.ssh/id_rsa.
Your public key has been saved in/root/.ssh/id_rsa.pub.
The key fingerprint is:
e1:9b:9a:b8:4d:ea:2c:e7:0c:49:bd:a7:47:fa:b4:4b [email protected]
The key ' s Randomart image is:
+--[RSA 2048]----+
| |
| |
| . |
| . . . |
| . . S |
| . . .. o |
| O. OE O |
| . +ox.+ |
| =x+b. |
+-----------------+
You can see two files in the/root/.ssh directory at this time:
-RW-------. 1 root root 1675 Dec 5 05:02 Id_rsa
-rw-r--r--. 1 root root 396 Dec 5 05:02 id_rsa.pub
Copy the key to another machine so that the login machine does not enter a password:
[email protected]. ssh]# ssh-copy-id-i id_rsa.pub [email protected]
Test, found that login ssh 10.1.1.4 does not require a password.
Copy the Id_rsa and id_rsa.pub to 10.1.1.4, and do the same Ssh-copy-id action on 10.1.1.4, so that the two-way SSH login does not require a password.
And the same SSH key is used.
Linux SSH does not need to enter a password method