Linux establishes a one-way trust relationship (lets SSH connect without entering a password)

Source: Internet
Author: User
Traditional manual establishment of one-way trust relationship: When we use the SSH command, we will find that each time we have to enter a password, this experiment can be implemented SSH connection without entering the password. First, on the Server1 (192.168.199.128) 1, create a new user #useradd liu2, switch user #su-liu3, generate key #ssh-keygen (all hit Enter) 4. Establish a public key file #cd. ssh/#cat id_ Rsa.pub >authorized_keys#chmod Authorized_keys Second, in Server2 (192.168.199.129) 1, the first new user #useradd liu2, switch User #su- Liu3. Ssh#mkdir. Ssh#chmod. ssh/#su-root Three, back to Server1 (192.168.199.128) 1, change back to root user #su-root2, Pass the previously established key file to Server2 (192.168.199.129) #scp/home/liu//.ssh/authorized_keys 192.168.199.129:/home/liu/.ssh Four, Change Authorized_keys permissions to Server2 #chown Liu:liu/home/liu/.ssh/authorized_keys Five, test #su-liu#ssh 192.168.199.129 If you do not need to enter the password again, it proves that a one-way trust has been established.


Linux establishes a one-way trust relationship (lets SSH connect without entering a password)

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.