两台主机
- 华为云:121.37.138.197
- 阿里云:8.140.14.49
以下操作两台主机上均需要执行:
生成秘钥
ssh-keygen -t rsa
开启ssh服务
service sshd start
上传公钥
上传公钥 id_rsa.pub ,需要在 /root/.ssh 路径下,上传过程需要输入对方密码验证
cd /root/.ssh
ls
ssh-copy-id -i id_rsa.pub root@121.37.138.197
ssh-copy-id -i id_rsa.pub root@8.140.14.49
互通免密验证
ssh root@121.37.138.197
ssh root@8.140.14.49