Configuring a Linux host for SSH without password access

Source: Internet
Author: User

Through the certificate signing to the Linux host SSH no password access, using Ssh-keygen and Ssh-copy-id to achieve rapid certificate generation and public key issued, where Ssh-keygen generate a pair of keys, using Ssh-copy-id to distribute the generated public key. Here's how:

To create a key in Host a (192.168.0.100), execute:

SSH-KEYGEN-T RSA

, there is a query directly press ENTER, you will generate a pair of keys under/root/.ssh/, where Id_rsz is the private key, Id_rsa.pub is the public key (need to be issued to the B host user. SSH directory, also requires the same name as Authorized_keys file). (b Host: 192.168.0.101) You can also specify the certificate generation location by using the-f parameter.

Ssh-keygen-t rsa-f/root/.ssh/id_rsa #指证书的生成位置

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8B/C9/wKioL1hZAArDjcKwAAEjt-VoUeY525.png "title=" Wkiom1g3o3ua3kgbaaa8csq1en4232.png-wh_500x0-wm_3-wmp_4-s_3099150748.png "alt=" Wkiol1hzaardjckwaaejt-vouey525.png "/>

Next sync public key file id_rsa.pub to target host, we recommend using Ssh-copy-i Public key Copy tool (also can use SCP copy), command format:/usr/bin/ssh-copy-id [-I [Identity_file]] [[Email Protected]] machine.

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

Verify that SSH password is not configured successfully, run SSH [email protected], if you go directly to the root account prompt, the configuration is successful.


Configuring a Linux host for SSH without password access

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.