& Nbsp; 1. generate a key on the server (192.168.0.1) [root @ chanjet21 ~] # Cd/root/. ssh/[root@chanjet21.ssh] # lsknown_hosts [root@chanjet21.ssh] # ssh-keygen-tdsaGeneratingpublic/privatedsake 1. generate keys on the server side (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.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service