标签:div login sshd conf bsp nbsp 没有 pre /etc
一、添加和root权限一样的用户
1、
adduser admin
passwd admin (修改密码)
然后输入密码 (密码简单了通不过)
系统提示输入确认密码后再输入一次。OK添加成功。
2、修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:
vim /etc/sudoers
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
admin ALL=(ALL) ALL
二、禁止root远程登录
需要编辑/etc/ssh/sshd_config。
vim /etc/ssh/sshd_config 找到 PermitRootLogin
改为 PermitRootLogin no
重启 service sshd restart
结束语:
这下就禁止了root用户登陆了 用admin登陆 。 搞这么复杂就是为了安全.
你只是禁止了root用户登陆,没有禁止别的用户,先用别的用户登陆,在 su root 切回root用户
切换到root用户还要在输如密码
标签:div login sshd conf bsp nbsp 没有 pre /etc
原文地址:http://www.cnblogs.com/jianz/p/7979250.html