SSH-free login for Linux

Source: Internet
Author: User

setting up SSH login without password can improve the security of our host. SSH login with no password to use the public and private keys. Linux can generate a public/private key pair with Ssh-keygen, followed by CentOS for example.

Example diagram: Experimental host A no key access host B

Actual Combat part:

Host Cent65 (192.168.1.65)

Host Cent67 (192.168.1.67)

Now want to 65 through SSH password-free login to 67. First, take the root account login as an example.

1. Generate a public/private key pair under the a machine.

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

P followed by a space and two single quotes

P represents a password, - P ' indicates a blank password, or it can be used without - P parameters, this will take three times to enter, with - P just one return. The command will generate a pair of keys Id_rsa and id_rsa.pubunder the /root/.ssh directory .

2. Copy the/root/.ssh/id_rsa.pub under the 65 host to the /root/.ssh/authorized_keys file of the 67 host, and create the/ROOT/.SSH on the 67 machine first. This directory, with SCP replication.

3. [Email protected] ~]# scp/root/.ssh/id_rsa.pub [email Protected]:/root/.ssh/authorized_keys

Since there is no password-free login, enter the root password of the 67 host once.

4, attention!!! The Authorized_keys must be !!!

It is now possible to implement a no-key login.

SSH-free login for Linux

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.