[Email protected] ~]$ CD
[[email protected] ~]$ mkdir. SSH (centos6.0 not required)
[[email protected] ~]$ chmod. SSH (centos6.0 no need)
[[email protected] ~]$ ssh-keygen-t RSA
Generating public/private RSA key pair.
Enter file in which to save the key (/HOME/DEVEN/.SSH/ID_RSA): (Enter)
Enter passphrase (empty for No passphrase): (carriage return)
Enter same passphrase again: (enter)
Your identification has been saved In/home/deven/.ssh/id_rsa.
Your public key has been saved in/home/deven/.ssh/id_rsa.pub.
The key fingerprint is:
89:56:D6:4A:B2:6C:4A:05:86:AE:CD:7D:80:DD:3C:F1 [email protected]
Intermediate Process Direct 3 carriage return. In the ~/.ssh/directory, two files were generated: Id_rsa (the private key file is placed locally) and id_rsa.pub (the public key file is placed on the trust server).
On Node2, do the same with the user Deven identity.
2. Summarize all public key file id_rsa.pub into a total authentication file Authorized-keys:
[email protected] ~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[[email protected] ~]$ ssh [email protected] Cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
3. Currently there is a complete authentication key file on Node1, this time, copy it to the corresponding directory of the NODE2 host
[Email protected] ~]$ SCP ~/.ssh/authorized_keys [email Protected]:~/.ssh/authorized_keys
As with other users, the goal is to generate Id_rsa under/home/user/.ssh/, Id_rsa.pub, and then append id_rsa.pub to the Authorized_keys file of the cluster share.
It is recommended that all files under/home/user/.ssh/be set to 700 permissions.
This article is from the "7727197" blog, please be sure to keep this source http://7737197.blog.51cto.com/7727197/1663099
Linux dual-machine/multi-machine Trust