1. Generate your own public key
ssh-keygen -t rsa
Generate the public key of the machine The generated address can be seen during the generation process
Find the location of the generated public key, where id_rsa.pub is the public key, copy
2. Deploy the public key to the server
Enter own server
enter directory
cd ~/.ssh/
vi authorized_keys
Copy the copied public key to authorized_keys to complete