[Linux] SSH Public Key Login

Source: Internet
Author: User
Tags asymmetric encryption

SSH Public Key login is more secure than password login due to easy disclosure of password password. SSH can easily use asymmetric encryption technology to contract two machines, the steps are as follows:

First step local machine generated key pair

directive: Ssh-keygen

Function: The public key (Id_rsa.pub) and the private key (ID_RSA) are generated locally (~/.ssh/), where the private key is used by the machine and cannot be compromised. The public key is provided to the remote server and appended to the other's public key file (~/.ssh/authorized_keys).

Ssh-keygen "'

In this way, two files Id_rsa.pub and Id_rsa will appear in the local directory ~/.ssh/.

The second step is to copy the public key to the remote server

directive: Ssh-copy-id

Function: Copy the local ~/.ssh/rsa.pub to the remote server and append to the ~/.ssh/authorized_keys file. This step can also be done through the SCP directive.

ssh-copy- ID [email protected]

You can log on to the remote server to confirm that the contents of the locally generated rsa.pub are included in the ~/.ssh/authorized_keys file.

Part three log on to the remote server
SSH [Email protected]
Other

Additional configuration information/etc/ssh/sshd_config

[Linux] SSH Public Key Login

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.