在linux下新建的用户去执行sudo命令时会提示如下错误:
xxx is not in the sudoers file.This incident will be reported.
要解决该错误很简单:
切换到root用户
sudo root -
修改sudoers文件权限
chmod u+w /etc/sudoers
编辑sudoers文件
root ALL=(ALL) ALL
xxx ALL=(ALL) ALL #添加此行在root行之下
撤销修改权限
chmod u-w /etc/sudoers
PS:
允许用户username执行sudo命令(需要输入密码).
username ALL=(ALL) ALL
允许用户组username里面的用户执行sudo命令(需要输入密码).
%username ALL=(ALL) ALL
允许用户username执行sudo命令,并且在执行的时候不输入密码.
username ALL=(ALL) NOPASSWD: ALL
允许用户组username里面的用户执行sudo命令,并且在执行的时候不输入密码.
%username ALL=(ALL) NOPASSWD: ALL
Ubuntu下is not in the sudoers file问题解决:http://www.linuxdiyf.com/linux/12538.html
怎样解决“XXX is not in the sudoers file”错误:http://www.linuxdiyf.com/linux/9439.html
Ubuntu技巧之is not in the sudoers file解决方法:http://www.linuxdiyf.com/linux/9015.html
Linux下创建新用户出现XXX is not in the sudoers file.错误提示:http://www.linuxdiyf.com/linux/7605.html