配置文件:sshd_config
root下编辑文件:
配置更新: vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
注释配置: vim /etc/ssh/ssh_config
GSSAPIAuthentication yes
生成秘钥
交互提示都默认
ssh-keygen -t rsa
公钥拷贝
将每一台的公钥拷贝到其他所有服务器上
命令形如:
scp .ssh/id_rsa.pub hdfs@node2.com:/home/hdfs/.ssh/id_rsa.pub.node1
公钥使用(将其他所有服务器的公钥,加入到本机的authorized_keys中)
cat .ssh/id_rsa.pub.node1 >> .ssh/authorized_keys