vi /etc/ssh/sshd-config

找到#PermitRootLogin yes

修改为 PermitRootLogin no

:wq

重启ssh服务

service sshd restart