無
無
Linux集群規模20↑∞≥台,需相(xiàng)互間(jiān)免密登陸。
先選擇一(yī)台主機(∞≥jī)保存所有(yǒu)主機(jī)的(de)密鑰,然後将密€鑰複制(zhì)到(dào)所有(yǒu)主機←≥(jī)。
1.登陸每台主機(jī)創建ssh.pub:
[root@master-1 ~]# ssh-keyg←÷≈en
Generating public/priv₽☆ate rsa key pair.
Enter file in which to save the ke"&&y (/root/.ssh/id_rsa)® :
Enter passphrase (em≤✘>pty 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:
SHA256:Z0rzrrX1DA+Yjw6S9iFnoGQ∞♥φfQc9NVn1PXEXHohC/gno root@jumpserver
The key's randomart image is:
+---[RSA 3072]----+
| . ±→₹+o.. +B|
| . o ♣ ←+.. o *|
|  ε☆;. o .... +.|
| <> . . .. .|
| o o S + ∞₹±. |
| o o * * + &nβΩ≤bsp; |
| . B E = + &nb♥ε∞sp;|
| . B = = * ≤α |
| oo= .☆↓♦ + |
+----[SHA256]-----+
2. 每台主機(jī)執行(xíng)ssh-c÷φπopy-id root@master-1複制(zhì)到(dào)§σMaster-1
3.登陸Master-1将密碼複制(zhì)到(dào)所有(yǒu)主機(≈♣jī):
scp .ssh/authorized_keys root™≠@master-2:/root/ssh.txt
scp .ssh/authorized_keys root@ma××$ster-3:/root/ssh.txt
scp .ssh/authorized_keys root@nod✔δ∏©e-1:/root/ssh.txt
....
4.登陸每台主機(jī),将ssh.txt追加到(dào).s'™sh/authorized_keys即可(kě)。
cat /root/ssh.txt >> /root≈π≈/.ssh/authorized_keys
無