Linux 打通ssh无密码登录
像hadoop和spark这类的集群,因为master节点要控制slave节点,以及各节点之间要交互信息,所以需要各节点之间能够互相无密码登录。
通过RSA保存密码,
基本操作如下:
Step 1: Create Authentication SSH-Kegen Keys on – Node0
ssh-keygen -t rsa
Step 2: Create .ssh Directory on – Node1
ssh root@192.168.110.202 mkdir -p .ssh
Step 3: Upload Generated Public Keys to – Node1
cat .ssh/id_rsa.pub | ssh root@192.168.110.202 'cat >> .ssh/authorized_keys'
Step 4: Set Permissions on – Node1
ssh root@192.168.110.202 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"