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.