👨🎓👨🎓博主:发量不足
个人简介:耐心,自信来源于你强大的思想和知识基础!!
📑📑本期更新内容:虚拟机Hadoop集群交换 SSH 密钥与验证SSh无密码登录🔥🔥
📑📑下篇文章预告:安装Hadoop、配置Hadoop 配置文件🔥🔥🔥
目录
交换 SSH 密钥
(1) 将 Master 节点的公钥 id_rsa.pub 复制到每个 Slave 点
(2) 在每个 Slave 节点把 Master 节点复制的公钥复制到 authorized_keys 文 件
(3) 在每个 Slave 节点删除 id_rsa.pub 文件
(4)将每个 Slave 节点的公钥保存到 Master
(5) slave2: scp ~/.ssh/id_rsa.pub hadoop@master:~/
验证 SSH 无密码登录
(1)在master上验证ssh无密码登录ssh slave1
交换 SSH 密钥
(1) 将 Master 节点的公钥 id_rsa.pub 复制到每个 Slave 点
master:scp ~/.ssh/id_rsa.pub hadoop@slave1:~/
scp ~/.ssh/id_rsa.pub hadoop@slave2:~/
(2) 在每个 Slave 节点把 Master 节点复制的公钥复制到 authorized_keys 文 件
slave1: cat ~/id_rsa.pub >>~/.ssh/authorized_keys
slave2: cat ~/id_rsa.pub >>~/.ssh/authorized_keys
(3) 在每个 Slave 节点删除 id_rsa.pub 文件
slave1: rm -f ~/id_rsa.pub
slave2: rm -f ~/id_rsa.pub
(4)将每个 Slave 节点的公钥保存到 Master
slave1: scp ~/.ssh/id_rsa.pub hadoop@master:~/
master: cat ~/id_rsa.pub >>~/.ssh/authorized_keys
master: rm -f ~/id_rsa.pub
(5) slave2: scp ~/.ssh/id_rsa.pub hadoop@master:~/
master: cat ~/id_rsa.pub >>~/.ssh/authorized_keys
master: rm -f ~/id_rsa.pub
验证 SSH 无密码登录
master切换到slave1、slave2不需要密码
slave1切换到master不需要密码
slave2 切换到master不需要密码
(1)在master上验证ssh无密码登录
ssh slave1
ssh master
ssh slave2
ssh master