Fedora提示 xxxis not in the sudoers file.this incident will be reported解决办法 [转]

由于Fedora默认不添加用户到sudoers,因此当我们使用sudo时就会出现“is not in the sudoers file.”的错误。

添加方法如下:

1.进入root模式
su - 
注意:su和-之间有空格

输入当前用户的密码

2.添加写权限
chmod u+w /etc/sudoers

3.将自己加入到sudoers中

gedit /etc/sudoers

注意此处使用的是gedit,如果你熟悉vi,vim也可以使用,不过对于我这个初学者来说gedit对于解决问题来说还是很方便的

进入之后,搜索 root
看到这样的一行:root ALL=(ALL)  ALL
在下面填上类似的信息,例如你的用户名字叫 user 则添加: user ALL=(ALL)   ALL
添加好后保存

4.撤销写权限
chmod u-w /etc/sudoers

OK,问题应该能解决

原文地址:https://www.cnblogs.com/ymy124/p/2509518.html