前提條件:主機A、B。固然能夠有更多的機器。ssh
在主機A上
ssh-keygen -t rsa # 一直按回車
cd ~/.ssh
cp id_rsa.pub authorized_keys
ssh-copy-id -i b_username@B # 更多的機器,能夠執行多條複製命令測試
# 測試
ssh localhost # 第一次須要輸入yes,以下
# Are you sure you want to continue connecting (yes/no)? yes
exit
ssh Bit