Configure SSH one-way password-less access in CentOS

Source: Internet
Author: User
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, you can use sshkey to generate a public key and a private key for verification, instead of entering the root password each time. Server Architecture: System: CentOS6.5x64 Master A: 192.168.0.150 remote host B: 192.168.0.151 principle: Recently I have been studying A file system. I need to install software remotely for the client without an SSH password, in addition, it is inconvenient to input the root password to remotely upload files to the client, so you can use the ssh key to generate a public key and 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, so we can log on to the remote host B from the master A ssh 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 rsaNote: 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.151Enter the root password of the remote host B once.
 
3,Test remote host B without a password on the master side
[root@localhost ~]# ssh root@192.168.0.151We can see that the root password of host B is no longer lost. you can remotely connect to host B from A SSH.
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.