有时为了特殊需求,只允许普通账户登陆Linux,而不允许root账户登陆,而普通账户登陆后,然后再su 到root下是可以的。打开sshd的配置文件
vim /etc/ssh/sshd_config 加入一行:
PermitRootLogin no
重启sshd服务: service sshd restart
本文共 199 字,大约阅读时间需要 1 分钟。
有时为了特殊需求,只允许普通账户登陆Linux,而不允许root账户登陆,而普通账户登陆后,然后再su 到root下是可以的。打开sshd的配置文件
vim /etc/ssh/sshd_config 加入一行:
PermitRootLogin no
重启sshd服务: service sshd restart
转载于:https://blog.51cto.com/11937277/1879419