ubuntu出现“xxx is not in the sudoers file. This incident will be reported“解决方法

编程入门 行业动态 更新时间:2024-10-27 07:27:38

ubuntu出现“xxx is not in the sudoers file. This incident will be reported“<a href=https://www.elefans.com/category/jswz/34/1770089.html style=解决方法"/>

ubuntu出现“xxx is not in the sudoers file. This incident will be reported“解决方法

ubuntu1604下普通用户用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/sudoers3.编辑sudoers文件vim /etc/sudoers找到这行root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL(这里的xxx是你的用户名)ps:这里说下你可以sudoers添加下面四行中任意一条youruser         ALL=(ALL)        ALL%youruser        ALL=(ALL)        ALLyouruser        ALL=(ALL)        NOPASSWORD:ALL%youruser        ALL=(ALL)     NOPASSWORD:ALL   第一行:允许用户youruser执行sudo命令(需要输入密码)第二行:允许用户组youruser里面的用户执行sudo命令(需要输入密码)第三行:允许用户youruser执行sudo命令,并且在执行的时候不输入密码第四行:允许用户组youruser里面的用户执行sudo命令,并且在执行的时候不输入密码4.撤销sudoers文件写权限命令:chmod u-w /etc/sudoers

更多推荐

ubuntu出现“xxx is not in the sudoers file. This incident will be reported“解决方法

本文发布于:2024-03-23 22:08:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1743405.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:解决方法   sudoers   xxx   ubuntu   reported

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!