linux双机ssh互信方法总结
生活随笔
收集整理的這篇文章主要介紹了
linux双机ssh互信方法总结
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
方法一:
1. ? ??ssh-keygen -t rsa -b 1024?? -t表示類型?-b表示密鑰大小(當然也可以直接使用ssh-keygen生成) 2. ? ? ?test@local-host$ ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host?(這樣傳輸的秘鑰認證也是test用戶的,請根據自己需求,來做相應的操作;默認保存在了remote-host的相應用戶的.ssh/authorized_keys中)
3. ? ? ?ssh remote-host?(還是注意使用當然用戶)
? ? ? ? ? 另一臺服務器重復此操作
方法二:
? ? ssh-keygen -t rsa -b 1024?創建秘鑰過程相同
? ??chmod -R 700 ~/.ssh;將公鑰復制到另一臺機器上,寫入authorized_keys中。
? ? ?scp?公鑰?root@另一臺IP:root/
? ? ?cat?公鑰>>/root/.ssh/authorized_keys;chmod 600 /root/.ssh/authorized_keys(在remote-host中操作)另一臺服務器重復此操作
轉載于:https://blog.51cto.com/5404542/1792177
總結
以上是生活随笔為你收集整理的linux双机ssh互信方法总结的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: arcgis api for js共享干
- 下一篇: linux 其他常用命令