配置无密码登陆本机
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
然后将~/.ssh/id_rsa.pub即公钥发送到对端机器,然后对端机器执行
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
即可