https://www.jianshu.com/p/0f9b72d691c2
https://www.cnblogs.com/276815076/p/10449354.html
1.前提:假设 机器A为客户端 机器B为服务端 (机器A登入机器B免密)
2.在机器A上生成公钥、私钥
ssh-keygen
#生成后的公钥、私钥 存放在/root/.ssh/下的id_rsa、id_rsa.pub
3.将机器A的公钥内容追加到机器B的授权文件中去(/root/.ssh/authorized_keys)
scp id_rsa.pub root@机器B:/root/.ssh/authorized_keys
4.当机器B上没有/root/.ssh 目录时需要创建后再执行步骤3
ssh root@机器B “mkdir /root/.ssh”