yum -y install openssh-clients
如果出现 Permissions 0644 for ‘/root/.ssh/id_rsa’ are too open. 等错误显示了,原来只要把权限降到0600就ok了
输入命令
chmod 0600 /root/.ssh/id_rsa
然后就可以密钥登陆了
systectl stop sshd
systemctl start sshd
#配置开机启动
cat >> /etc/rc.local << EOF
/etc/init.d/sshd start
EOF