其他分享
首页 > 其他分享> > 简易版本一键免密登陆(通过ssh-copy-id)

简易版本一键免密登陆(通过ssh-copy-id)

作者:互联网

简易版本一键免密登陆(通过ssh-copy-id)

  1. 修改主机名配置hosts
cat >>/etc/hosts<<EOF    #添加各个节点hosts解析
172.20.2.222      cm-server
172.20.2.203      hadoop-1
172.20.2.204      hadoop-2
172.20.2.205      hadoop-3
EOF
  1. 配置cm-server免密钥登录其他节点
ssh-keygen -t rsa     #在cm-server生成密钥对
for num in `seq 1 3`;do ssh-copy-id -i /root/.ssh/id_rsa.pub root@hadoop-$num;done

标签:免密,cm,rsa,num,ssh,copy,id
来源: https://www.cnblogs.com/Dr-wei/p/16653788.html