在 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

posted @ 2020-12-01 02:15  不是豆豆  阅读(166)  评论(0编辑  收藏  举报
友情链接:迷途