Today’s article is mainly to teach you how to achieve a secret login between servers.

1, run the following command on all servers:

ssh-keygen -t dsa -P ” -f ~/.ssh/id_dsa

The master server

Slave1 server

Slave2 server

2, Run the following command on all servers:

cat /.ssh/id_dsa.pub >>/.ssh/authorized_keys

The master server

Slave1 server

Slave2 server

3. Send the id_dsa.pub public key on each server to the/TMP folder on other machines, for example, on the master server

scp ~/.ssh/id_dsa.pub slave1:/tmp/

scp ~/.ssh/id_dsa.pub slave2:/tmp/

The master server

4. Add the public key to authorized_keys on other machines and run the following command:

cat /tmp/id_dsa.pub >>~/.ssh/authorized_keys

cat /tmp/id_dsa.pub >>~/.ssh/authorized_keys

Slave1 server

Slave2 server

5. Similarly, send the public key to other servers on other machines, and append the public key to their respective authorized_keys on other servers.

Slave1 server

Slave2 server

6. Finally, test the keyfree connection.

The master server

Slave1 server

Slave2 server

At this point, keyless login is configured. This section uses three servers as an example. If there are three or more servers, perform the following operations.

Have you learned anything after reading this article? Please share it with more people

Learn more about Web crawlers and data mining in Python at pdcFighting.com/