Realize password-free login for a Linux user

1. Check whether there is a ~/.ssh/authorized_keys file in the user’s root directory.

If there is no .ssh folder, execute the following command:

ssh localhost

If there is no authorized_keys file, just create it directly.

touch ~/.ssh/authorized_keys

2. Copy the local public key content to authorized_keys

The public key of windows is under C:\Users\Lenovo\.ssh, and id_rsa.pub is the public key.

 

Just copy the contents of the public key to authorized_keys.

3. If there is no ssh folder locally or there is no id_rsa.pub.

Open Git Bash and enter the following command in the console

ssh-keygen -t rsa -C "[email protected]"

Then just press Enter.

Guess you like

Origin blog.csdn.net/qq_48480384/article/details/131181141