Mutual trust between SSH hosts-password-free

Source: Internet
Author: User

1. How to avoid password-free mutual trust between ssh-Principle: Private Key Encryption and Public Key decryption

Establish an SSH trust relationship between experiment web1 (192.168.204.7) and web2 (192.168.204.9)

The command ssh-keygen is used to generate the public key and private key.

 

Operate on web1

1. automated commands

Ssh-keygen-t rsa-p'-f ~ /. Ssh/id_rsa

 

-T indicates the type

-P specifies the password

-F specifies the file

Result:

Save the private key to id_rsa and save it to id_rsa.pub.

[[Email protected] ~] # Ls. Ssh/
Id_rsa id_rsa.pub

2. Install the public key on the remote host.

Ssh-copy-ID [-I [identity_file] [[email protected] Machine

Ssh-copy-ID-I. Ssh/id_rsa.pub [email protected]

Result: authentication information is recorded on web2.

[[Email protected] ~] # Cat. Ssh/authorized_keys
Ssh-RSA Secure + wmk3/secure + qgqnchkmutfeixguvcm + K + ilhapqrf6mun + gjxybqablh403iod0fyp57vsu6wfg + 1 W = [email protected]
[[Email protected] ~] # Ls-L. Ssh/authorized_keys

 

 

 

Mutual trust can be achieved by performing the same operation on web2

 

Mutual trust between SSH hosts-password-free

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.