Implementing SSH without password login: using Ssh-keygen and Ssh-copy-id

Source: Internet
Author: User

Ssh-keygen generates a public and private key pair.
Ssh-copy-id The local public key is copied to the remote machine's Authorized_keys file, Ssh-copy-id can also let you have to the remote machine/home/username/.ssh and ~/.ssh/authorized_ The right to the keys.


Operation Record:
1) First step: Use Ssh-keygen on the local machine to generate the public key private key pair
#ssh-keygen-t RSA [All-way default carriage return]
This will generate the public and private key files in the. SSH directory in the current user's home directory: Id_rsa.pub, Id_rsa

2) Copy the public key to the remote machine with Ssh-copy-id
#ssh-copy-id-i/root/.ssh/id_rsa.pub [email protected] [copy the local public key to the remote machine, such as B machine]

Note: Ssh-copy-id writes key to the ~/. Ssh/authorized_key. File in the remote machine.

3) In this way, the machine login to the above remote machine (b machine) do not enter the password
#ssh [email protected]

Implementing SSH without password login: using Ssh-keygen and Ssh-copy-id

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.