SSH remote connection based on key connection
1. Create two hosts: suppose host A is 192.168.100.10, host B is 192.168.100.11
Enter the command ssh-keygen -t rsa[dsa] on host A, generally use rsa and press enter four times to generate the key file and private key file,
You can use ll -a .ssh/ to view the file, as shown in the figure:
2. Copy the public key to host B and use ssh-copy-id to copy, you can ll .ssh/ to view the file
3. Send a request to host B, the command is: ssh [email protected], you can find that you can log in directly to host B.