1、root用户登陆; 2、vim /etc/ssh/sshd_config; 3、文本28行左右PermitRootLogin属性修改成no即可 : 4、修改完重启服务:systemctl restart sshd.service