All the following. Ssh directories are in the user's home directory ~
1. You need to enable pubkey verification for sshd_config on the server.
Pubkeyauthentication Yes
Authorizedkeysfile. Ssh/authorized_keys
2. Public Key file generated by the client through SSH-keygen
Run ssh-keygen directly to enter the password without entering it. Otherwise, the password will be required for verification. Isn't this just to save the need to enter the password ..
The default private key and public key are named under. SSH
Id_rsa id_rsa.pub
Import the content of the id_rsa.pub file to the user on the server ~ /. Ssh/authorized_keys
Cat id_rsa.pub> authorized_keys
3. You can create a config file in the client. Ssh directory.
Host localhost # server alias
Hostname 127.0.0.1 # Server IP Address
User user # login Username
Port 22 # ssh port number
Identityfile ~ /. Ssh/id_rsa # Private Key address
4. You can use SSH-T localhost to test whether it is successful. If you need to check the server response information, use SSH-Vt localhost.
However, the local test is stuck in sending env Lang,
You can actually log on through SSH.
5. Git uses SSH to push pull and you don't need to enter the password each time. This is the key.
Git SSH public key verification