# 1 打开系统的密码验证功能:
vim /etc/ssh/sshd_config
#允许使用密码登录(注释此行 就是允许证书登录)
PasswordAuthentication yes
# 2 打开root 远程登录功能:
#允许root认证登录(no 禁止root登录,普通用户可以切换身份到root)
PermitRootLogin yes
# 3 重启系统sshd
systemctl restart sshd
或者
/etc/init.d/sshd restart
3、设置免密登录
ssh-kengen -t rsa
ssh-copy-id -i .ssh/id_rsa.pub root@$IP