现在的位置: 首页 > 常见问题 > 正文

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

2013年12月30日 常见问题 ⁄ 共 796字 ⁄ 字号 XXX is not in the sudoers file. This incident will be reported已关闭评论 ⁄ 阅读 2,029 次

本文介绍了在Linux使用过程中遇到 is not in the sudoers file 时的解决办法。

用sudo时提示"xxx is not in the sudoers file. This incident will be reported."其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了

例子:

问题描述

问题描述

下面是解决方法:

1)进入超级用户模式。也就是输入"su",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。

步骤一

步骤一

2)编辑/etc/sudoers文件。也就是输入命令"gedit /etc/sudoers",进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"ld ALL=(ALL) ALL"(这里的ld是你的用户名),然后保存退出。

步骤二

步骤二

切换到刚才添加的普通用户,执行sudo命令就可以了!

另外一种修改/etc/sudoers这个文件的方法:

1)进入超级用户模式。也就是输入"su",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。

2)执行 visudo     (切记,此处没有vi和sudo之间没有空格)

移动光标,到"root ALL=(ALL) ALL“下面

按i,进入insert模式,再加一条配置:

ld  ALL=(ALL) ALL  (这里的ld是你的用户名)

3)按Esc

4)输入“:x”(保存并退出)

×