XXX is not in the sudoers file

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情
解决方案:
首需要切换到root身份
$su -
(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)

然后
$visudo     //切记,此处没有vi和sudo之间没有空格

1、移动光标,到最后一行
2、按a,进入append模式
3、输入
your_user_name ALL=(ALL)  ALL
4、按Esc
5、输入“:w”(保存文件)
6、输入“:q”(退出)

这样就把自己加入了sudo组,可以使用sudo命令了。 
CentOS执行sudo提示xxx is not in the sudoers file 文章发布地址: https://abelsu7.top/2018/05/09/not-in-the-sudoers-file/ 作者:苏易北,转载请注明原文链接 在新安装的CentOS系统中,使用默认创建的用户执行sudo命令时终端报错: xxx is not in the sudoers file. This incident will be reported. 报... 阅读详情

相关推荐

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

hellomyself的专栏 4986

解决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 解决方法

当在终端执行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

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

Linux操作系统中vi无法输入中文的原因, E35: No previous regular expression

用一句话概括原因以及解决方法的话: 就是默认vi进去的是命令模式,你需要通过在键盘输入“i,a,o”随便一个英文进入编辑模式,然后按一下shift键切换为中文就行了。 (适用于不知道怎么切换中文,以及适用于看到输入的中文,按回车键却没有中文输入进去的情况) 1.首先我们在终端执行 ‘’vi test‘’命令时,默认打开test文件(若没有则会自动创建) 此处我已经在test文件里面编辑了一些内容了: 2.接着我们处于的是vi工作模式(一共有命令模式,编辑模式,命令项模式或底行模式.

weixin_50746407的博客 1万+

xxx is not in the sudoers file

使用sudo xxx命令报错。

Zero's Blog 1497

XXX is not in the sudoers file解决

环境:VirtualBox4.1 + RedHat Linux 6 问题:用sudo命令时提示"xxx is not in the sudoers file. This incident will bereported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo命令。 解决:只要修改一下/etc/sudoers文件就行了。   1.进入超级用户模式。也就是输入"su-",

DBA@Robin 4872

解决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.

当在终端执行 sudo 命令时,提示用户 xxx is not in the sudoers file.

Emperdre的博客 988

linux下遇到xxx is not in the sudoers file

问题: 使用sudo命令时遇到错误,xxx(当前用户名) is not in the sudoers file。This incident will be reported。 是因为用户没有加入到sudo的配置文件里,你的用户没有权限使用sudo。 解决: 1.切换到root用户,如果你用"su -”,"su - root","su",“sudo”,"sudo -i"都不行,报错“su:

yunyi4367的博客 740

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

xxx is not in ther sudoers file

问题 非root账号使用sudo命令进报错xxx is not in ther sudoers file,使用这个命令可以临时提升权限,这样比使用root来操作更安全,因为root什么都能做,不熟悉的话,很容易出事。所以sudo即可以提供一定的特权,又不至于使权限泛滥。下面是解决这个问题的方法。 解办方式 第一步:切换到root ~$ su root 第二步:修改/etc/sudoers 这里要...

weixin_40763897的博客 2024

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
上一篇: CentOS DNS resolv重启无效的解决方法
下一篇: VS2008 如何实现远程调试
tszhao
博客等级 码龄19年 36粉丝 49原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值