Establish trust relationships between Centos users

Source: Internet
Author: User
There are two machines a and B. now you need to add user1 of machine a to the user2 user trust list of Machine B, so that user user1 of machine a can directly ssh to user 2 of Machine B step: 1, enter Machine a/home/user1 /. run mkdir-p/home/user1 /. ssh: Check whether there is an id_rsa in this directory. there are two machines a and B. now you need to add user1 of machine a to the user2 user trust list of Machine B, so that user user1 of machine a can directly ssh to user user2 of Machine B.

Steps:

1. enter Machine a/home/user1 /. run mkdir-p/home/user1 /. ssh: Check whether there is an id_rsa.pub file in the directory. if not, run the ssh-keygen-t rsa command to generate the file. copy the content of the file;

2. go to machine B/home/user2 /. create an ssh directory if no one exists. execute vi authorized_keys in the directory, paste the copied content in step 1 in the last line, and save and exit;

3. add "/etc/hosts. allow" of the vi B server and a line: sshd: [here is the ip address of machine a. If it is a dual-path, add two ip addresses]

Run ssh user2 @ B in the user1 directory of machine a to connect to Machine B.

Related Article

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.