SSH set private key for two Linux hosts without password access

Source: Internet
Author: User
Create a public and private key on the server host (called a host): Ssh-keygen-t RSA all the way back, if you want to set a passphrase, set a passphrase when prompted passphrase to view the generated public and private keys: LS ~/.ssh id_ Rsa.pub id_rsa Public key content output to the appropriate file: Cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys Delete the original public key file: Rm-f ~/.ssh/id_ Rsa.pub settings File property is set to 400:chmod ~/.ssh/authorized_keys copy the private key to another Linux host (called the B host) file placement path: ~/.ssh/id_rsa Set file access chmod 600 ~/.ssh/id_rsa in this way, from the B host login a host, you can not enter the login password, to achieve no password directly login!

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.