CentOS configuration ssh One-way no password access

Source: Internet
Author: User
Tags free ssh

Recently in the study of a file system, you need to remotely install software to the client, and need no SSH password access, in addition to remote to the client to pass files, each time the root password is inconvenient, it is thought to use SSH key to generate a public key, private key to verify, and avoid having to enter the root password each time.

Server Architecture:
System: CentOS 6.5 x64
Main control Terminal a:192.168.0.150
Remote host b:192.168.0.151

principle:
Using SSH key to generate the public key, the private key, the key is equivalent to a key, and the public key is equivalent to aDoor lock, of course, we are holding the key to unlock, the same reason, we put the key on the local server, that is, Server A, the public key on the remote server, that is, the far end of Host B, then we can from the main terminal a ssh password login to the remote Host B.

Steps:
1 . Generate a public and private key file without SSH password access on the host console a
[[email protected] ~]# ssh-keygen -t rsa
Note: The execution of the command, press three consecutive carriage return can be generated.

2 . Upload the public key from the main terminal to the remote Host B
[[email protected] ~]# ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]
You need to enter the root password of the remote Host B

3, in the main control side test password-free SSH remote Host B
[[email protected] ~]# ssh [email protected]
You can see that you have not lost the root password of Host B, you can remote from a SSH to B.

CentOS configuration ssh One-way no password access

Related Article

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.