歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux上操作SSH互信

Linux上操作SSH互信

日期:2017/2/28 14:54:53   编辑:Linux教程

Linux上普通用戶登錄10.10.18.7以後,要想和10.10.18.8以及10.10.18.9互相訪問而不需要密碼

需要在10.10.18.7上做以下操作:

ssh-keygen -t rsa //此處一路回車
cat .ssh/id_rsa.pub >> .ssh/authorized_keys //登錄本地不需要密碼

scp .ssh/id_rsa.pub 10.10.18.9:~/ //登錄10.10.18.9不需要密碼
ssh 10.10.18.9 'cat id_rsa.pub >> .ssh/authorized_keys'
scp .ssh/id_rsa.pub 10.10.18.8:~/ //登錄10.10.18.8不需要密碼
ssh 10.10.18.8 'cat id_rsa.pub >> .ssh/authorized_keys'

同樣:也需要在10.10.18.8和10.10.18.9上做相應操作(修改命令中的ip地址)

Copyright © Linux教程網 All Rights Reserved