SSH has an authentication system that allows SSH communication between host and host to not need to enter a password this is very useful for us, especially in remote backup
Let's take a look at the detailed content
Suppose there are now 3 servers in which
192.168.1.100 for backup Server This article is referred to as 100
192.168.1.101 for Web Server This article is referred to as 101
192.168.1.102 for Web Server This article is referred to as 102
192.168.1.103 for Web Server This article is referred to as 103
We may need authorization 100 to access 101, 102, 103
Before you can use the SCP tool, log in 100 and install openssh-clients after installation
Run Ssh-keygen after
Press ENTER 3 times
In this way, Id_rsa, and id_rsa.pub are generated under the/root/.ssh/path, where Id_rsa is the key and the id_rsa.pub is the public key
Call the SCP to copy 100 of the public key to 101, 102, 103 servers
Scp/root/.ssh/id_rsa.pub Root@192.168.1.101:/root
Scp/root/.ssh/id_rsa.pub Root@192.168.1.102:/root
Scp/root/.ssh/id_rsa.pub Root@192.168.1.103:/root
Alternatively, copy the 100 public key to 101, 102, 103 servers such as wget,
Log on to the 101, 102, and 103 servers individually to execute the following command
Install Openssh-clients
Run Ssh-keygen
Press ENTER 3 times
Rename the 100 public key and copy it to/root/.ssh/authorized_keys
You can now use SSH directly to link 101, 102, 103, or SCP remote copy files from 100 without entering a password
[note] The/ROOT/.SSH directory automatically generates an invalid manual creation for the Ssh-keygen tool