Configure SSH one-way password-less access in CentOS

Source: Internet
Author: User

Configure SSH one-way password-less access in CentOS
Recently, I have been studying a file system, which requires Remote Installation of software for the client without an SSH password. In addition, it is inconvenient to input the root password each time to remotely upload files to the client, the ssh key is used to generate a public key and a private key for verification, instead of entering the root password each time.

Server Architecture:
System: CentOS 6.5x64
Master A: 192.168.0.150
Remote Host B: 192.168.0.151

Principle:
The ssh key is used to generate a public key and a private key. The key is equivalent to a key, and the Public key is equivalent to a lock. Of course we use the key to unlock the key. In the same way, we put the key on the local server, that is, server A puts the public key on the remote server, that is, the remote host B. Then we can log on to the remote host B from the master Assh without A password.

Steps:
1. Generate A public key and private key file without an SSH password on host A of the master.
[Root @ localhost ~] # Ssh-keygen-t rsa
Note: you can press enter three times in a row to generate a command.

2. Upload the public key from the master to the remote host B.
[Root @ localhost ~] # Ssh-copy-id-I/root/. ssh/id_rsa.pub root@192.168.0.151
Enter the root password of the remote host B once.

3. Test Remote Host B without a password on the master side.
[Root @ localhost ~] # Sshroot@192.168.0.151
We can see that the root password of host B is no longer lost. You can remotely connect to host B from A SSH.

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.