With OpenSSH in the Linux login SSH server, each prompt to enter a password, and use Vim NETRW plugin to edit the remote file every time after the change to save the password, very troublesome. Looking at the help documentation for NETRW, I found a way to automatically log in to an SSH server:
1. Create a public/private key pair (on the client machine)
SSH-KEYGEN-T RSA (Saving the file in ~/.ssh/id_rsa as prompted)
Enter the above command (in parentheses without input), you will be prompted to enter passphrase, directly press two times enter, do not use passphrase.
You can see the two files generated in the ~/.ssh directory, Id_rsa and id_rsa.pub.
Tip: If you already have a Id_rsa key file in the. SSH directory, you can change it to a different name, but still put it in the. SSH directory.
2. Create a new. SSH directory on the SSH server
Log in to the SSH server first, then enter the following command
Cdmkdir-p. Sshchmod 0700. SSH
3. Establish authentication keys on the server
On the client machine (note that it is not on the server), enter the following command
SSH serverhostname cat ' >> ' ~/.ssh/authorized_keys ' < ~/.ssh/id_rsa.pub
Enter the login password.
4. OK, done, ssh serverhostname login server try, should not enter the password.
Linux does not need to enter the password automatic login SSH server method