转载地址:http://blog.csdn.net/sinat_36118270/article/details/62899093

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 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

解决linux下sudo更改文件权限报错xxxis not in the sudoers file. This incident will be reported.相关推荐

  1. Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法

    Ubuntu下普通用户用sudo执行命令时报"xxx is not in the sudoers file.This incident will be reported"错误,解决 ...

  2. Linux ** is not in the sudoers file. This incident will be reported.

    Linux 报错: ** is not in the sudoers file. This incident will be reported. 错误原因 顾名思义,该用户没有在 sudoers fi ...

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

    xxx is not in the sudoers file.This incident will be reported.的解决方法 参考文章: (1)xxx is not in the sudoe ...

  4. linux把u盘只读文件,完美解决linux下U盘文件只读的问题

    完美解决linux下U盘文件只读的问题 1. 在终端运行如下命令 tail -f /var/log/syslog 2. 插入有只读文件系统故障的U盘 3. 观察命令行输出 输出局部如下: Jul  8 ...

  5. centos挂载u盘只读_完美解决linux下U盘文件只读的问题

    1. 在终端运行如下命令 tail -f /var/log/syslog 2. 插入有只读文件系统故障的U盘 3. 观察命令行输出 输出局部如下: Jul  8 16:44:50 cslouis-pc ...

  6. linux打开word乱码,解决linux下openoffice word文件转PDF中文乱码的问题

    网上很多介绍是由于jdk中的没有字体导致乱码,而我遇到的是转换过程并未报错,但转换后的PDF中是乱码,尝试在jre/lib/fonts/中增加字体,还是不能解决问题,因此可以判断非jre字体问题,是l ...

  7. Hadoop之——Linux下sudo命令报错:hadoop is not in the sudoers file. This incident will be reported.

    转载请注明出处:https://blog.csdn.net/l1028386804/article/details/93380235 当在终端执行sudo命令时,系统提示"cuser is ...

  8. linux下u盘目录带锁,完美解决linux下U盘文件只读的问题

    1. 在终端运行如下命令 tail -f /var/log/syslog 2. 插入有只读文件系统故障的U盘 3. 观察命令行输出 输出局部如下: Jul  8 16:44:50 cslouis-pc ...

  9. Linux中新建用户用不了sudo命令问题:rootr is not in the sudoers file.This incident will be reported解决

    Linux中新建用户用不了sudo命令问题:rootr is not in the sudoers file.This incident will be reported解决 参考:https://b ...

  10. 解决Linux下MySQL启动错误Starting MySQL.Manager of pid-file quit without updating file.[FAILED]...

    刚装完MySQL,启动时报如下错误: Starting MySQL.Manager of pid-file quit without updating file.[FAILED] 解决Linux下My ...

最新文章

  1. 2021-08-27 思考:1000瓶药水,1瓶有毒,老鼠毒发24h,如何用最少的老鼠在24h内找出毒药?
  2. VTK:PolyData之LoopBooleanPolyDataFilter
  3. python与正则表达式(part5)--re模块使用
  4. 译 | 使用Roslyn分析器高效编写更好的代码
  5. java redis id生成器_基于redis的分布式ID生成器
  6. 英特尔多核联合实验室授牌仪式
  7. s3c2440第一个裸奔程序——跑马灯(转)
  8. sql server 监视_使用SQL Server Reporting Services进行快速,肮脏的服务器监视
  9. 游戏筑基开发之利用文件函数取出配置文件(ini文件)的数据实体(C语言)
  10. 开源转场库HYBControllerTransitions
  11. 程序猿代码面试指南 PDF
  12. .net 6 简单使用redis
  13. 豆丁 道客巴巴 千图网 千库网 包图网 我图网 摄图网 巧办网 万方设计 中国知网 VIP会员一个月开通方法,十网通用
  14. 网课题库收录API接口以及免费网课查询API接口
  15. C++程序设计:字符图形输出(空白三角形)
  16. 发票自动处理识别和分类
  17. 说说“安规”的那些事儿
  18. 46-动态编程语言(python)大作业-记忆翻牌游戏
  19. 祈求代码不出 Bug 该拜哪个“神仙”?
  20. 面试经验:腾讯微信事业群 - 微信总部机器学习岗面试

热门文章

  1. spring整合kaptcha验证码
  2. 上传本地项目到码云仓库【图文详解】
  3. 死锁——哲学家就餐问题
  4. 不限速的免费下载神器,牛逼!
  5. python爬取qq空间相册图片_如何用 Python 爬取 QQ 空间说说和相册?
  6. Matlab多项式基本运算(1)( polyval和polyvalm的区别)
  7. Web服务器(Apache)与Servlet容器(Tomcat)
  8. Unity3D发布微信小程序
  9. 论文_毕业设计复现机器学习模型案例大本营(收藏)
  10. 串口协议发送数据格式详细分析