Ubuntu——"xxx is not in the sudoers file.This incident will be reported" 错误解决方法

Ubuntu下普通用户用sudo执行命令时报如题所示错误,解决方法就是在/etc/sudoers文件里给该用户添加权限。如下:

1.切换到root用户下

2./etc/sudoers文件默认是只读的,对root来说也是,因此需先添加sudoers文件的写权限,命令是:
chmod u+w /etc/sudoers

3.编辑sudoers文件
vi /etc/sudoers
找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)

ps:这里说下你可以sudoers添加下面四行中任意一条
youuser            ALL=(ALL)                ALL
%youuser           ALL=(ALL)                ALL
youuser            ALL=(ALL)                NOPASSWD: ALL
%youuser           ALL=(ALL)                NOPASSWD: ALL

第一行:允许用户youuser执行sudo命令(需要输入密码).
第二行:允许用户组youuser里面的用户执行sudo命令(需要输入密码).
第三行:允许用户youuser执行sudo命令,并且在执行的时候不输入密码.
第四行:允许用户组youuser里面的用户执行sudo命令,并且在执行的时候不输入密码.

4.撤销sudoers文件写权限,命令:
chmod u-w /etc/sudoers

时间: 2024-08-01 10:46:24

Ubuntu——"xxx is not in the sudoers file.This incident will be reported" 错误解决方法的相关文章

企业运维案例:xxx is not in the sudoers file.This incident will be reported” 错误解决方法

CentOS6系统下,普通用户使用sudo执行命令时报错: xxx is not in the sudoers file.This incident will be reported" 解决方法就是在/etc/sudoers文件里给该用户添加权限.如下: 1.切换到root用户下 2./etc/sudoers文件默认是只读的,对root来说也是,因此需先添加sudoers文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件vim /etc/sudoers

centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法

1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 #passwd tommy   //修改密码 Changing password for user tommy. New UNIX password:     //在这里输入新密码 Retype new UNIX password:  //再次输入新密码 passwd: all authentication tokens updated successfully.

解决:xxx is not in the sudoers file.This incident will be reported.的解决方法

Linux中普通用户用sudo执行命令时报"xxx is not in the sudoers file.This incident will be reported"错误,解决方法就是在/etc/sudoers文件里给该用户添加权限.如下: 1.切换到root用户下  方法为直接在命令行输入:su,然后输入密码(即你的登录密码,且密码默认不可见). 2./etc/sudoers文件默认是只读的,对root来说也是,因此需先添加sudoers文件的写权限,命令是: 即执行操作:chmo

xxx is not in the sudoers file.This incident will be reported.的解决方法 (一般用户不能执行sudo)

1.切换到root用户下 2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件vi /etc/sudoers找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)ps:这里说下你可以sudoers添加下面四行中任意一条youuser            ALL=(ALL)                ALL%youuser           ALL=(ALL)  

xxx is not in the sudoers file.This incident will be reported.的解决方法

1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去. 2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件vi /etc/sudoers找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名) ps:这里说下你可以sudoers添加下面四行中任意一条youuser            ALL=(ALL)                ALL%youuser

Linux中普通用户用sudo执行命令时报”xxx is not in the sudoers file.This incident will be reported”错误

Linux中普通用户用sudo执行命令时报"xxx is not in the sudoers file.This incident will be reported"错误,解决方法就是在/etc/sudoers文件里给该用户添加权限.如下: 1.切换到root用户下 方法为直接在命令行输入:su,然后输入密码(即你的登录密码,且密码默认不可见). 2./etc/sudoers文件默认是只读的,对root来说也是,因此需先添加sudoers文件的写权限,命令是: 即执行操作:chmod

用sudo时提示"xxx is not in the sudoers file. This incident will be reported.

现象: 非Root用户在使用sudo命令时,提示:"xxx is not in the sudoers file. This incident will be reported.(xxx为用户名) 解决办法: 使用 su – root 切换到root用户,编辑sudoers文件 vim /etc/sudoers找到"root ALL=(ALL)"在此行下面添加一行 "xxx ALL=(ALL) ALL" //xxx 为用户名 保存即可.

xxx is not in the sudoers file. This incident will be reported

问题描述: 新建用户执行命令sudo chmod 700 ,提示输入root命令. 输入三次错误. 提示 yourid is not in the sudoers file. This incident will be reported 问题解决 more /etc/sudoers 增加用户 root    ALL=(ALL)     ALL liuyuxing  ALL=(ALL)    ALL 这样你的用户就可以使用所有的命令了,但是每次使用之前要输入自己的密码. **** 区别 sudo

UBuntu sudo 命令 :xxx is not in the sudoers file. This incident will be reported.

[1]分析问题 提示内容翻译成中文即:用户XXX(一般是新添加的用户名称)没有权限使用sudo. 解决方法修改新用户的权限,具体操作即修改一下/etc/sudoers文件. [2]切换至root用户模式 命令:su - 备注:这里命令加有"-" ,与su是不同的. 在用命令"su"时只是切换到root,但没把root的环境变量传过去,还是当前用户的环境变量. 而用"su -"命令会将环境变量也一起切换过去(可以亲测,两个命令后分别查看环境变量$P