免密ssh

服務器ssh免密登陸:

1、在每臺服務器上都執行ssh-keygen -t rsa 生成密鑰

[root@jw01 .ssh]# ssh-keygen -t rsa
[root@jw02 .ssh]# ssh-keygen -t rsa
[root@kt01  .ssh]# ssh-keygen -t rsa
[root@kt02  .ssh]# ssh-keygen -t rsa
標題

2、複製公鑰到其他節點

ssh-copy-id -i .ssh/id_rsa.pub [email protected]	#複製密鑰
ssh-copy-id -i .ssh/id_rsa.pub [email protected]	#複製密鑰

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章