Establish a secret-free communication between multiple Linux hosts

Source: Internet
Author: User

Set up A Secret communication example between multiple Linux hosts: A to B set up the secret-free communication
    • First step a generates a key pair

      ssh-keygen -t rsa  

-t specifies the type of secret key
RSA secret key Type

Key directory: /root/.ssh/ (if the root account, note: The key pair is not shared between different users)
Private key id_rsa
Public Key id_rsa.pub Lock

    • The second step is to edit the authentication file under the host root account (other accounts)

      vi /root/.ssh/authorized_keys

      Copy the public key content generated by the previous a host id_rsa.pub to the B host authorized_keys

    • The third step is to edit the SSH configuration file for Host B

      vim /etc/ssh/sshd_config
      Find the AuthorizedKeysFile %h/.ssh/authorized_keys comment to remove
    • Step Fourth Restart the B host SSH service

      /etc/init.d/ssh restart
    • Fifth step a host verification through

      ssh [email protected]主机ip
    • If there is a C host with the B root account to establish a secret-free communication, you can directly append the generated public key to the root account of the B host authorized_keys , and then restart.

Establish a secret-free communication between multiple Linux hosts

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.