主節(jié)點1上敲长,一路回車生成秘鑰
ssh-keygen -t rsa
復(fù)制到其他節(jié)點 1,2,3都進(jìn)行律想。
ssh-copy-id root@flink-01
ssh-copy-id root@flink-02
ssh-copy-id root@flink-03
# 各機(jī)器創(chuàng)建秘鑰
ssh-keygen -t rsa
# 從各個機(jī)器匯集公鑰到ip1
scp ~/.ssh/id_rsa.pub root@ip1:~/.ssh/2.id.rsa.pub
scp ~/.ssh/id_rsa.pub root@ip1:~/.ssh/3.id.rsa.pub
scp ~/.ssh/id_rsa.pub root@ip1:~/.ssh/4.id.rsa.pub
scp ~/.ssh/id_rsa.pub root@ip1:~/.ssh/5.id.rsa.pub
scp ~/.ssh/id_rsa.pub root@ip1:~/.ssh/6.id.rsa.pub
# 在ip1里生成秘鑰認(rèn)證文件
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/2.id.rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/3.id.rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/4.id.rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/5.id.rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/6.id.rsa.pub >> ~/.ssh/authorized_keys
# 向集群機(jī)器分發(fā)認(rèn)證文件
scp ~/.ssh/authorized_keys root@ip2:~/.ssh/
scp ~/.ssh/authorized_keys root@ip3:~/.ssh/
scp ~/.ssh/authorized_keys root@ip4:~/.ssh/
scp ~/.ssh/authorized_keys root@ip5:~/.ssh/
scp ~/.ssh/authorized_keys root@ip6:~/.ssh/
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者