Implement password-free login to Linux server with public key private key

Source: Internet
Author: User
  • Principle
  • The client generates the public key, copies the public key to the Linux server, and connects to the server with its own private key. The implementation is as follows:
  • If you have two Linux servers A and b,a to implement password-free login b
  1. A execute ssh-keygen-t RSA will generate Id_rsa (private key) and id_rsa_pub (public key) in/root/.ssh
  2. Under B

    Mkdir/root/.ssh

    chmod 700/root/.ssh

  3. Create a Vi/root/.ssh/authorized_keys under B
  4. Add the public key content of a generated to the/root/.ssh/authorized_keys file in B, either by copying or pasting, or by copying the key in the same way

Implement password-free login to Linux server with public key private key

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.