实验环境:
主机1:controller ip:192.168.1.10
主机2:compute ip:192.168.2.10
controller主机执行ssh-keygen -t rsa生成秘钥
查看秘钥是否生成
compute主机执行ssh-keygen -t rsa生成秘钥
controller主机给compute主机分发公钥:scp .ssh/id_rsa.pub 192.168.1.20:/root/.ssh/authorized_keys
controller主机执行:cp .ssh/id_rsa.pub .ssh/authorized_keys
两台主机均要修改authorized_keys文件权限为600
chmod 600 .ssh/authorized_keys
controller主机免密码登录compute主机