user is not in the sudoers file. This incident will be reported 解决方法(Centos8.4和Centos8.5和Ubuntu)

编程入门 行业动态 更新时间:2024-10-27 01:29:04

user is not in the sudoers file. This incident will be reported <a href=https://www.elefans.com/category/jswz/34/1770089.html style=解决方法(Centos8.4和Centos8.5和Ubuntu)"/>

user is not in the sudoers file. This incident will be reported 解决方法(Centos8.4和Centos8.5和Ubuntu)

Centos8.4和Centos8.5版本和乌班图系统,

在一般用户下执行sudo命令提示user is not in the sudoers file. This incident will be reported.

解决方法:
       一、$where is sudoers -------找出文件所在的位置,默认都是/etc/sudoers
            
       二、#chmod u+w /etc/sudoers    以超级用户登录su - root ,修改文件权限即添加文件拥有这的写权限 限,ls -al /etc/sudoers 可以查看原文件的权限。
      
       三、vim /etc/sudoers 编辑文件,在root ALL=(ALL)ALL行下添加XXX ALL=(ALL)ALL,XXX为你的用户名。

root    ALL=(ALL)       ALL
avconuser    ALL=(ALL)       ALL

添加方法:找到root行,按下”i“键进入编辑模式添加即可!编辑好后esc键进入一般模式,“:w!",":q!"保存退出!
 

最后, #chmod u-w /etc/sudoers 回到文件的原权限!

更多推荐

user is not in the sudoers file. This incident will be reported 解决方法(Centos8.4和C

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

发布评论

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

>www.elefans.com

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