Often in the Linux between the SCP command transmission files, each time the need to enter the other machine password, very troublesome. This approach allows both parties to automatically pass the key authentication without having to enter the password manually:
1,root Landing, on both sides of the machine execute the following command and return all the way to generate the RSA private key and public key:
[root@ ~]# CD. SSH
[root@. ssh]# ssh-keygen-t RSA
Generating public/private RSA key pair.
Enter file in which to save the key (/ROOT/.SSH/ID_RSA):
Enter passphrase (empty for no passphrase):
Enter same Passphrase again:
Your identification has been saved In/root/.ssh/id_rsa.
Your public key has been saved in/root/.ssh/id_rsa.pub.
The key fingerprint is:
E7:ad:46:67:45:1a:df:da:cd:c7:32:e3:bf:76:8e:a9
2, on both sides of the machine view/root/.ssh, found that all generated two files: Id_rsa, id_rsa.pub, Id_rsa for the private key, id_rsa.pub for the public key:
[root@. ssh]# ll
Total 32
-RW-------1 root 1675 Aug 22:09 Id_rsa
-rw-r--r--1 root root 415 Aug 22:09 id_rsa.pub
-rw-r--r--1 root root 222 Aug 8 22:52 known_hosts
3, on both sides of the machine/root/.ssh/directory to establish Authorized_keys files, and the other party's public key id_rsa.pub file contents of the test to Authorized_keys, so that can be implemented without the password transfer file.
4, if more than one machine, the other machine's public key file content appended to the local Authorized_keys file, can be implemented locally to the other machine without entering a password.
This article from the "Small Hebebe Technical Space" blog, please be sure to keep this source http://babyhe.blog.51cto.com/1104064/636752
See more highlights of this column: http://www.bianceng.cn/OS/Linux/