XXX is not in the sudoers file解决

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情

环境:VirtualBox4.1 + RedHat Linux 6

问题:用sudo命令时提示"xxx is not in the sudoers file. This incident will bereported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo命令

解决:只要修改一下/etc/sudoers文件就行了

 

1.进入超级用户模式。也就是输入"su-",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(注:您也可以直接用root登录);

 

2.添加文件的写权限,因为sudoers这个文件只允许读,不允许写入。输入命令"chmod u+w /etc/sudoers";

 

3.编辑/etc/sudoers文件。输入命令"vi/etc/sudoers",输入"i"进入编辑模式,找到这一行:"root ALL=(ALL) ALL",在这行下面添加"xxxALL=(ALL) ALL"(这里的xxx是你的用户名),然后按Esc键,输入":wq",保存退出;

 

 

4.撤销文件的写权限,还原文件的读写状态。输入命令"chmod u-w /etc/sudoers"

 

参考资料:http://apps.hi.baidu.com/share/detail/33864699
su: Authentication failure 以及xxx is not in the sudoers file 问题的解决办法 这里其实是两个问题: 1. su: Authentication failure; 2. xxx is not in the sudoers file,This incident will be reported. 第一个问题是无法进入root用户,第二个问题是没有sudo权限。 这里会有一个很有意思的事情,当我们发现自己没有root用户权限的时候,会想到用用sudo pa... 阅读详情

相关推荐

is not in the sudoers file 解决方法

当在终端执行sudo命令时,系统提示“lizh is not in the sudoers file”: 其实就是没有权限进行sudo,解决方法如下(这里假设用户名是cuser): 1.切换到超级用户:$ su root 2.打开/etc/sudoers文件:$vim /etc/sudoers 3.修改文件内容: 找到“root ALL=(ALL) ALL”一行,在下面插入新的一行,内容是“lizh ALL=(ALL) ALL”,然后在vim键入命令“:wq!”保存并退出。

小灰灰的博客 5万+

Linux 普通用户使用 sudo 命令报 xxx is not in the sudoers file 问题解决

当我们使用sudo命令切换用户的时候可能会遇到提示以下错误:xxx is not in the sudoers file. This incident will be reported,xxx是你当前的用户名,究其原因是用户没有加入到sudo的配置文件里 切换到root用户,执行以下命令: $ visudo 在打开的配置文件中,找到root ALL=(ALL) ALL,在下...

专注基础架构领域 2314

解决Ubuntu中“is not in the sudoers file“问题

然而,有时在运行sudo命令时,可能会遇到类似于"username is not in the sudoers file"的错误消息,这意味着当前用户没有被授权执行sudo命令。需要注意的是,修改sudoers文件是一项敏感的操作。在进行修改之前,请确保仔细检查和理解所做的更改,并确保只为信任的用户授予sudo权限。如果你已经知道具有管理员权限的用户名和密码,可以直接登录该用户。现在,你应该能够以你的用户名执行sudo命令,而不再遇到"is not in the sudoers file"的错误消息。

KjsPrivate的博客 3235

is not in the sudoers file 解决

当在shell执行sudo命令时,系统提示“xxxis not in the sudoers file”: 原因: 用户xxx没有权限去sudo 解决方法是给其赋权,步骤如下: 1.切换到超级用户:su 2.打开/etc/sudoers文件:vim /etc/sudoers 3.修改文件内容: 找到 “root ALL=(ALL:ALL) ALL”一行, 在下面插入内容“xxx ALL=(ALL:ALL) ALL”, 然后:wq!强制保存并退出 O...

weixin_36476763的博客 8581

解决xxx is not in the sudoers file.

linux下新建的用户去执行sudo命令时会提示如下错误: xxx is not in the sudoers file.This incident will be reported. 要解决该错误很简单:切换到root用户 sudo root - 修改sudoers文件权限 chmod u+w /etc/sudoers 编辑sudoers文件 root ALL=(ALL) ALL

米刀文 1444

xxx is not in the sudoers file解决

用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。下面是修改方法: 1)进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你...

qq_38787653的博客 9904

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

lzjsqn的专栏 3714

Linux解决xxx is not in the sudoers file

在进行相关文件操作时没有权限,使用sudo 后提示:xxx is not in the sudoers file,This incident will be reported. 解决办法: 切换超用户:su root   输入超级用户密码 修改用户配置文件、/etc/sudoers的权限:chmod  u+w /etc/sudoers 使用vi 编辑/etc/sudoers 配置文件,在...

zdg_c的博客 1762

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

创建的Centos 虚拟机,开机后使用sudo su 切换root 用户是报错。提示,说明该用户无任何 sudo 权限,(绕过权限验证),要么直接重置 root 密码、要么将普通用户加入 sudoers 文件。

程序猿踩坑集锦 1396

CentOS 7安装‘开发工具’组后,你还需要检查这3个关键配置才算真正可用

本文详细介绍了在CentOS 7上安装'Development Tools'组后的关键配置与优化步骤,包括核心组件验证、环境变量配置、开发库检查以及性能调优。通过国内镜像源配置和系统参数调整,确保开发环境高效可靠,适用于C/C++、Python等多种开发场景。

weixin_33672400的博客 401

CentOS──xxx is not in the sudoers file解决方法

CentOS──xxx is not in the sudoers file解决方法   2013-09-24 10:48:30|  分类: 默认分类 |  标签:centos   |举报 |字号 订阅         下载LOFTER客户端 前阵子比较来比较去,选了CentOS作Linux

余味Uyoung 594

Linux中“XXX is not in the sudoers file解决方法

问题描述 当在终端执行sudo命令时,系统提示“yzj is not in the sudoers file”: $ sudo ls Password: cuser is not in the sudoers file. This incident will be reported. 解决方法 导致这个的原因是没有权限进行sudo,解决方法如下(这里假设用户名是 yzj): 1.切换到...

MRYZJ的博客 1326

CentOS中出现xxx is not in the sudoers file解决方法

问题: 在终端中输入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.其中XXX是你的用户名,也就是说你的用户名没有权限使用sudo,只要修改一下/etc/sudoers文件就行了。下面是修改方法: 进入超级用户模式。也就是输入su -,系统会让你输入超

ClimberCoding 2577

怎样解决XXX is not in the sudoers file”错误

sudo是一个允许特定的用户组用另一个用户(典型的是root)的特权来运行一个命令。sudo有详细的日志功能,并且提供了对用户可通过sudo来运行哪些命令的细粒度控制。 Sudo vs. Su su命令也提供了同样的特权提升功能,两者不同的是它们认证过程和特权变化的粒度。su允许你从你的登录会话切换到另一个用户的会话,然后你可以随心所欲地用该用户的特权来运行任何程序,但是你需要知道目标用户的密

vanchan博客 2068

xxx is not in the sudoers file 解决

解决方案: 首需要切换到root身份 $su - (注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样) 然后 $visudo     //切记,此处没有vi和sudo之间没有空格 1、移动光标,到最后一行 2、按a,进入append

Xuebing's Blog 1382

xxx is not in the sudoers file解决方法

用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/group文件就行了。下面是修改方法: 1)进入超级用户模式。 2)修改/etc/group文件,可以使用"vigr"命令,等同于用vim打开group文件

Mirale的专栏 2935
上一篇: Java处理本身包含双引号的String
下一篇: Java基于TCP的Socket编程练习
Wentasy
博客等级 码龄15年 2390粉丝 673原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值