Linux does not need to enter the password automatic login SSH server method

Source: Internet
Author: User
Tags ssh server

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.