CentOS 7中解决“xxx is not in the sudoers file”的问题

问题
今天在CentOS7中用非root用户执行命令(加sudo,sudo命令允许你以超级用户的身份执行命令)时,显示:
xxx is not in the sudoers file. This incident will be reported.
原因
原来只有用户属于wheel group组时才能使用sudo命令,可以使用usermod命令将用户添加到group组。
解决办法
usermod命令用于修改用户模式,通过usermod -aG wheel testuser可以将testuser用户添加到wheel组,这样testuser用户就能使用sudo命令了。

把用户添加到wheel组后,还需要确保/etc/sudoers文件中%wheel ALL=(ALL) ALL这一行没被注释(默认情况下是没被注释的),默认情况下/etc/sudoers文件只有读权限(是的,对root用户也只有读权限),若想编辑该文件可以使用一个特殊的工具组件——visudo,直接运行visudo命令将会打开/etc/sudoers文件,找到如下几行:

## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)  ALL

可以看到%wheel ALL=(ALL) ALL这一行是否被注释。

CentOS 7中解决“xxx is not in the sudoers file”的问题相关推荐

  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. 【sudo错误】xxx is not in the sudoers file.This incident will be reported解决

    文章目录 1.问题 2.分析 3.解决方法 3.1 手动修改 3.2 命令方式修改--sudo visudo 4.扩展说明 1.问题 xxx is not in the sudoers file.Th ...

  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. Ubuntu技巧之xxx is not in the sudoers file解决方法

    原文地址:http://www.linuxidc.com/Linux/2010-12/30386.htm 用sudo时提示"xxx is not in the sudoers file. T ...

  5. xxx is not in the sudoers file.This incident will be reported错误

    普通用户用sudo执行命令时报"xxx is not in the sudoers file.This incident will be reported"错误,解决方法就是在/e ...

  6. [已解决]user is not in the sudoers file. This incident will be reported.(简单不容易出错的方式)

    linux Ubuntu中报错,XXX is not in the sudoers file. This incident will be reported. 今天在学习的时候,不小心把自己的用户su ...

  7. 【Linux】XXX is not in the sudoers file …… 的解决方案

    XXX is not in the sudoers file -- 网上资料都告诉大家,解决方法是改root ALL=(ALL) ALL那里,可能有的新手看不懂,这里解释一下. 在终端执行sudo命令 ...

  8. xxx is not in the sudoers file. This incident will be reported.解決方法

    我们通常都是以普通用户登录linux, 在执行sudo时候会遇到 xxx is not in the sudoers file.  This incident will be reported. 解决 ...

  9. 解决xx is not in the sudoers file. This incident will be reported.问题

    问题.  xxx is not in the sudoers file. This incident will be reported.(当想要以 xxx的身份切换到root权限时,使用sudo su ...

最新文章

  1. 用Docker搭建Nexus私服
  2. js操作DOM对象(节点的增删改)
  3. Java,C++四舍五入
  4. r语言三维柱状图_R语言三维图的绘制
  5. tampermonkey怎么不能用了_普洱茶发霉了怎么办?能不能用太阳晒
  6. 有一个小白程序员,写了一个只能对5个数字进行排序的函数,现在有25个不重复的数字,
  7. django request对象和HttpResponse对象
  8. 关于webapp的一点思考
  9. NBA的字母哥如何拿到2415万美金年薪
  10. 小程序 ---- (setData关于赋值对象属性的问题)
  11. BackgroundWorker 简单使用教程 多个线程的创建
  12. c libxml2库的编译和使用
  13. cassandra 避免 allow filter 提升性能的方法
  14. LittleVGL开发之显示中文字体以及矢量图标
  15. 安装配置Axis2,为Eclipse安装配置Axis2插件教程
  16. 让你的动画不再生硬 Android插值器Interpolator使用秘籍
  17. 小程序 报错 errcode: 40029, errmsg: invalid code, hints: [ req_id: HQd79a0747th31 ]
  18. 一招解决win11系统字体模糊发虚不清楚的问题
  19. verilog中数组的定义_Verilog 常规数据定义
  20. 数据中台(一)数据中台详解

热门文章

  1. C++的标准库和C++的标准模板库(STL)
  2. 正向代理/反向代理/透明代理/透明模式
  3. 美团八年,学会了什么?
  4. android蓝光原盘播放软件,安卓系统真的拥有完美的蓝光原盘菜单导航吗?我来测试下...
  5. ps画画模糊笔刷_心得:关于Photoshop笔刷一些使用基础知识的讲解
  6. Git原理 SSH 公钥 私钥的理解
  7. python机器交易_[原创]Python 机器学习之 SVM 预测买卖 -- 基于 BotVS 量化平台
  8. 教育邮箱免费申请Jetbrains全家桶学生账号
  9. 西门子携手惠普,将3D打印技术的应用从原型创建扩展至批量生产
  10. python外汇兑换计算器_Python 3.2版本下实现简单的个人理财计算器(存款)脚本