No password-based SSH communication between hosts

Source: Internet
Author: User

node1:172.16.58.1

node2:172.16.58.3

Node1--> Node2


First generate the secret key in Node1

Execute Command ssh-keygen-p "

Ask the save path to enter directly by default,

Following prompts to save the private key as/root/.ssh/id_rsa

Public key is saved as/root/.ssh/id_rsa.pub

[[email protected] ~]# ssh-keygen-p '

Generating public/private RSA key pair.

Enter file in which to save the key (/ROOT/.SSH/ID_RSA):

Your identification has been saved In/root/.ssh/id_rsa.

Your public key has been saved in/root/.ssh/id_rsa.pub.

The key fingerprint is:

dc:62:ba:81:ac:dd:d9:93:fa:b4:9b:21:8d:e7:98:8c [email protected]

The key ' s Randomart image is:

+--[RSA 2048]----+

| |

| |

| |

| .       . |

|      S. |

| . .       = . |

|       o = =. |

| O +%o+ |

| . E Oobo |

+-----------------+

Pass the secret key to the Node2 host.

Ssh-copy-id-i. ssh/id_rsa.pub [Email protected]

[Email protected] ~]# ssh-copy-id-i Ssh/[email protected]

The authenticity of host ' 172.16.58.3 (172.16.58.3) ' Can ' tbe established.

RSA key fingerprint isdb:f8:11:fa:7d:30:95:44:1b:eb:ea:89:ee:fa:a1:27.

Is you sure want to continue connecting (yes/no)? Yes

warning:permanently added ' 172.16.58.3 ' (RSA) to the listof known hosts.

[email protected] ' s password:

Now try logging to the machine, with "ssh" [email protected] ' ", and check in:

. Ssh/authorized_keys

To make sure we haven ' t added extra keys thatyou weren ' t expecting.

Test for successful password-free login, no prompt to enter password

SSH 172.16.58.3 ' date ';d ate
[Email protected] ~]# ssh 172.16.58.3 ' date ';d ate

Wed Dec 16:51:41 CST 2014

Wed Dec 16:52:42 CST 2014


No password-based SSH communication between hosts

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.