Establish trust relationships between Linux servers

Source: Internet
Author: User

We often encounter this situation, from a Linux Server SSH to another Linux server, or use SCP or rsync to transmit data from one Linux server to another. Each operation requires a password for verification. If we establish a trust relationship between servers, we do not need to enter the password every time.

 

The trust relationship is as follows:

(1) switch to the root directory of the user who needs to establish a trust relationship

(2) execute the command: SSH-keygen-d

The prompt "Enter file in which to save the key" is displayed.
You can press enter to select the default option.

Prompt enter passphrase (empty for no passphrase)
You can press enter to select the default option.

The prompt "Enter same passphrase again" is displayed:
You can press enter to select the default option.

The. Ssh directory appears under the root directory of the user. Two files are generated under the. Ssh Directory: Public Key id_dsa and private key id_dsa.pub.

(3) create the authorized_key file under the. Ssh directory

(4) execute 1 ~ Step 3

(5) Take server a and server B as an example to Establish a trust relationship between server a and server B. Write the content of the public key id_dsa.pub of server a to the authorized_key of server B so that B can access a. Write the content of the public key id_dsa.pub of server B to the authorized_key of server, so that a can access B. In this way, access between A and B establishes a trust relationship.

(6) establish the same trust relationship between multiple servers (5). You only need to append the content of the public key id_dsa.pub to the authorized_key file.

 

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.