1. Generate a key on the server (192.168.0.1)
[Root @ chanjet21 ~] # Cd/root/. ssh/
[Root @ chanjet21. ssh] # ls
Known_hosts
[Root @ chanjet21. ssh] # ssh-keygen-t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/. ssh/id_dsa ):
Enter passphrase (empty for no passphrase ):
Enter same passphrase again:
Your identification has been saved in/root/. ssh/id_dsa.
Your public key has been saved in/root/. ssh/id_dsa.pub.
The key fingerprint is:
26: 67: d7: 2c: 27: 8f: 01: ea: a6: 6c: 34: d3: 9d: 04: ac: 08 root @ chanjet21
[Root @ chanjet21. ssh] # ls
Id_dsa id_dsa.pub known_hosts
The id_dsa id_dsa.pub file is generated.
2. # cp id_sda.pub authorized_keys
3. Copy the. ssh folder to overwrite the. ssh directory between nodes.
[Root @ chanjet21. ssh] # scp-r/root //. ssh/root@192.168.0.2:/root/
[Root @ chanjet21. ssh] # scp-r/root //. ssh/root@192.168.0.3:/root/
[Root @ chanjet21. ssh] # scp-r/root //. ssh/root@192.168.0.4:/root/
You can log on to each node from the server without a password.