CentOS 7中解决“xxx is not in the sudoers file”的问题
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”的问题相关推荐
- 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"错误,解决 ...
- 【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 ...
- 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 ...
- 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 ...
- 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 ...
- [已解决]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 ...
- 【Linux】XXX is not in the sudoers file …… 的解决方案
XXX is not in the sudoers file -- 网上资料都告诉大家,解决方法是改root ALL=(ALL) ALL那里,可能有的新手看不懂,这里解释一下. 在终端执行sudo命令 ...
- 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. 解决 ...
- 解决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 ...
最新文章
- 用Docker搭建Nexus私服
- js操作DOM对象(节点的增删改)
- Java,C++四舍五入
- r语言三维柱状图_R语言三维图的绘制
- tampermonkey怎么不能用了_普洱茶发霉了怎么办?能不能用太阳晒
- 有一个小白程序员,写了一个只能对5个数字进行排序的函数,现在有25个不重复的数字,
- django request对象和HttpResponse对象
- 关于webapp的一点思考
- NBA的字母哥如何拿到2415万美金年薪
- 小程序 ---- (setData关于赋值对象属性的问题)
- BackgroundWorker 简单使用教程 多个线程的创建
- c libxml2库的编译和使用
- cassandra 避免 allow filter 提升性能的方法
- LittleVGL开发之显示中文字体以及矢量图标
- 安装配置Axis2,为Eclipse安装配置Axis2插件教程
- 让你的动画不再生硬 Android插值器Interpolator使用秘籍
- 小程序 报错 errcode: 40029, errmsg: invalid code, hints: [ req_id: HQd79a0747th31 ]
- 一招解决win11系统字体模糊发虚不清楚的问题
- verilog中数组的定义_Verilog 常规数据定义
- 数据中台(一)数据中台详解
热门文章
- C++的标准库和C++的标准模板库(STL)
- 正向代理/反向代理/透明代理/透明模式
- 美团八年,学会了什么?
- android蓝光原盘播放软件,安卓系统真的拥有完美的蓝光原盘菜单导航吗?我来测试下...
- ps画画模糊笔刷_心得:关于Photoshop笔刷一些使用基础知识的讲解
- Git原理 SSH 公钥 私钥的理解
- python机器交易_[原创]Python 机器学习之 SVM 预测买卖 -- 基于 BotVS 量化平台
- 教育邮箱免费申请Jetbrains全家桶学生账号
- 西门子携手惠普,将3D打印技术的应用从原型创建扩展至批量生产
- python外汇兑换计算器_Python 3.2版本下实现简单的个人理财计算器(存款)脚本