Establish an SSH trust relationship between users on different hosts

Source: Internet
Author: User

Establish SSH mutual trust between the same user on host a, host B, and host C:

1. Generate a key pair on host a user hcwang (e.g.
$ Ssh-keygen-T RSA
2. Go to the. Ssh directory.
$ MV id_rsa.pub authorized_keys // (change to the default public key file name)
3. Transmit the Public Key id_rsa.pub to the target host B, c
$ SCP id_rsa.pub B: $ home/. SSH
$ Cat id_rsa.pub> authorized_keys // if no authorized_keys exists, run the MV id_rsa.pub authorized_keys command.
Similarly, for host C
$ SCP id_rsa.pub C: $ home/. SSH
$ Cat id_rsa.pub> authorized_keys

At this point, you can directly SSH from host a to host B and C without a password. If you want to SSH from host B or C, SSH to host a, or between host BC, you need a password. The solution is as follows:

4. Copy the private key and id_rsa of host a to the $ home/. Ssh directory of host B and C.
$ SCP id_rsa B: $ home/. SSH
$ SCP id_rsa C: $ home/. SSH

~ OK

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.