Linux SSH does not need to enter a password method

Source: Internet
Author: User

The method of using the certificate can solve the problem that SSH does not need to enter password.

This article uses the CentOS operating system, creates the SSH key, and realizes the trust between two or more machines. So that SSH login does not require the ability to enter a password.

First, create an SSH Key on a single machine:

[Email protected] ~]# Ssh-keygen

Generating public/private RSA key pair.

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

Created directory '/root/.ssh '.

Enter passphrase (empty for no passphrase):

Enter same Passphrase again:

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:

e1:9b:9a:b8:4d:ea:2c:e7:0c:49:bd:a7:47:fa:b4:4b [email protected]

The key ' s Randomart image is:

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

| |

| |

|        . |

|   . .       . |

| .   . S |

|  . . .. o |

| O. OE O |

| . +ox.+ |

|         =x+b. |

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

You can see two files in the/root/.ssh directory at this time:

-RW-------. 1 root root 1675 Dec 5 05:02 Id_rsa

-rw-r--r--. 1 root root 396 Dec 5 05:02 id_rsa.pub

Copy the key to another machine so that the login machine does not enter a password:

[email protected]. ssh]# ssh-copy-id-i id_rsa.pub [email protected]

Test, found that login ssh 10.1.1.4 does not require a password.

Copy the Id_rsa and id_rsa.pub to 10.1.1.4, and do the same Ssh-copy-id action on 10.1.1.4, so that the two-way SSH login does not require a password.

And the same SSH key is used.

Linux SSH does not need to enter a password method

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.