您的位置:首页 > 运维架构 > Linux

linux学习:增加user和sudo权限

2014-06-26 16:27 211 查看
linux

1.增加user

 /usr/sbin/useradd hjuser

password hjuser 为hjuser设置密码

*****

2.以这个user登录,sudo su的时候报错

“hjuser is not in the sudoers file. This incident will be reported.”

解决方法:

超级用户下

1)打开/etc/sudoers文件:$vi /etc/sudoers

2)找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),“wq!”保存并退出。 

"hjuser ALL=(ALL) ALL"

3.grep

grep 'ALL=' /etc/sudoers 

在/etc/sudoers中搜索包含“ALL=”的字符
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: