CentOS cluster ssh password-free login configuration
1. Update the Hosts file
Update the cluster node/etc/hosts file to ensure that all machines can access each other through hostname.
2. ssh Initialization Configuration
[Plain] view plaincopy
- # Ssh-keygen-trsa-f/root/. ssh/id_rsa-P''
- # Cat/root/. ssh/id_rsa.pub>/root/. ssh/authorized_keys
- # Sed's @ session \ s * required \ s * pam_loginuid.so@sessionoptionalpam_loginuid.so @ G'-I/etc/pam. d/sshd
[Plain] view plaincopy
- # Vim/root/. ssh/config
[Plain] view plaincopy
- Host *
- StrictHostKeyCheckingno
- UserKnownHostsFile =/dev/null
[Plain] view plaincopy
- # Cp/root/. ssh/config/etc/ssh/ssh_config
3. ssh password-free Configuration
Copy the id_rsa.pub public key file of the logon machine to each logged-on machine,
And append the content to the authorized_keys of the logged-on machine.
[Plain] view plaincopy
- # Cat <logon id_rsa.pub>/root/. ssh/authorized_keys
Now, you can run ssh <Host Name of the logged-on terminal> password-free logon.