Implementing key logins between Linux virtual machines

Source: Internet
Author: User

Server1 and Server2 in the same virtual network, Server1 hostname connection Server1 is used in Server2, and no password authentication is required.

Server1, hostname:hlmvmeast652 Internal ip:192.168.0.5

Server2, hostname:hlmvmeast653 Internal ip:192.168.0.6

1. Generate a key pair in Server1

2. Create the/ROOT/.SSH in Server2

3. Copy the public key id_rsa.pub from the Server1 to Server2,server2 place the file under/root/.ssh and rename it to Authorized_keys.

Operation Command Scp/root/.ssh/id_rsa.pub 192.168.0.6:/root/.ssh/authorized_keys

4. Server1 connection Server2, found also need password

5. Set SELinux in Server2 to permissive status

6. Connect the Server2 again in the Server1 and find that it can be successfully connected without a password

7. You can also connect using host name

Implementing key logins between Linux virtual machines

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.