在 centos 下禁止 root 通过 ssh 远程登录

1、请确保你有一个和root权限一样的用户(参见前文添加一个 sudoer 用户)

2、禁止root远程登录

需要编辑/etc/ssh/sshd_config。

vim /etc/ssh/sshd_config    找到 PermitRootLogin

改为 PermitRootLogin no

重启  service sshd restart

参考:https://blog.csdn.net/helloworld_dream/article/details/84994043

原文地址:https://www.cnblogs.com/xwgli/p/14065964.html