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

user is not in the sudoers file. This incident will be reported 解决方法(Centos8.4和Centos8.5和Ubuntu) u+w /etc/sudoers 以超级用户登录su - root ,修改文件权限即添加文件拥有这的写权限 限,ls -al /etc/sudoers 可以查看原文件的权限。三、vim /etc/sudoers 编辑文件,在root ALL=(ALL)ALL行下添加XXX ALL=(ALL)ALL,XXX为你的用户名。一、$where is sudoers -------找出文件所在的位置,默认都是/etc/sudoers。最后, #chmod u-w /etc/sudoers 回到文件的原权限! 阅读详情

linux Ubuntu中报错,XXX is not in the sudoers file. This incident will be reported.
今天在学习的时候,不小心把自己的用户sudo玩坏了(Broken sudo),于是上谷歌搜索XXX is not in the sudoers file. This incident will be reported.

看到一些大多数方法都是修改/etc/sudoers文件的内容,由于之前因为修改系统文件除了问题,进入recovery mode又把系统玩崩了(虚拟机),这次我就轻易不想修改系统文件

于是继续看,查到了另一个方法是进入recovery mode修改https://www.tecmint.com/fix-user-is-not-in-the-sudoers-file-the-incident-will-be-reported-ubuntu/
可是我也更不想进入recovery 模式啊~

但我还是仔细的看完了介绍的步骤,继续往下翻,看到许多评论都惊呼用这个方法解决了问题的时候

我再往下翻,看到了一个特别的评论:

简单解释下就是:
0、你的root需要设置好密码
sudo passwd root
像这样,我以一个新用户user1为例:

1、设置好密码之后,就可以切换到root用户:
su root
这里root可以省略,默认就是切换root
像这样

2、输入如下指令,将用户名添加到sudoers文件
sudo adduser image sudo
这里的image是我要恢复的用户名,你应该输入你想要恢复的用户名,像这样

3、su image(ctrl+d)切回到在使用的用户

此时用户image就被添加到了sudoers文件了,又可以使用sudo了:
使用sudo对用户进行修改:

于是完成,congratulation!果然高手在民间,评论区还是要多逛逛~
————————————————
版权声明:本文为CSDN博主「Moelimoe」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Moelimoe/article/details/105292219

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,在下... 阅读详情

相关推荐

基于ROS2系统开发机器人

以上是基于ROS 2开发机器人的基本流程和一个简单的发布者-订阅者示例。通过这个流程,你可以逐步扩展和优化你的机器人系统,实现更复杂的功能。

xuweilin的博客 1502

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

使用su-命令(有空格,用"su"命令只是切换到root,而没有把root的环境变量传过去,实际是当前用户的环境变量,用"su-"命令会将环境变量传过去,和root登录效果一样),然后修改sudoers文件即可(visudo)。2、按上sudosu,然后按照提示输入相应的root密码,就可登录到root权限下(这个命令下,一般不需要输入相应的root密码)。如果除了root用户,还有别的用户,可以切换到别的用户,然后切换到root用户下,修改sudoers文件。2、直接输入exit,...

m0_49448331的博客 5万+

ctftools-all-in-one使用说明

OAEP (Optimal Asymmetric Encryption Padding) 是一种用于RSA加密的填充方案,目的是提高RSA加密的安全性。在CTF比赛中,如果模数N的两个因子比较接近,使用"费马分解(N)"可能会更快地得到结果;OAEP 是 RSA 的一种标准填充方式(在 PKCS#1 v2.0+ 中定义),因此这类题目本质上仍是 RSA 题,但。,导致你不能直接用常规的 RSA 解密公式 �=�� mod �m=cdmodN 得到有意义的明文。如果你在 CTF 中遇到 RSA 题,

2501_91682449的博客 1735

user is not in the sudoers file

当在终端执行sudo命令时,系统提示“user1 is not in the sudoers file”: $ sudo ls Password: user1 is not in the sudoers file. This incident will be reported. 其实就是没有权限进行sudo,解决方法如下(这里假设用户名是cuser): 1.切换到超级用户:$ ...

childboy的博客 3738

EEG信号分析实战:从时域到频域,手把手教你用Python处理脑电数据

本文详细介绍了使用Python进行EEG信号分析的实战方法,涵盖时域分析、频域分析和时频分析三大核心技术。通过MNE-Python等工具,读者将学习如何从原始脑电数据中提取事件相关电位(ERP),解码脑波节律特征,并运用时频分析追踪动态神经活动。教程包含完整的代码示例和认知科学解释,适合神经科学研究者快速掌握EEG分析全流程。

pink的博客 1013

Applied Intelligence投稿经验分享(正在投稿中)

这几天在投稿Applied Intelligence这个期刊,过程很曲折,反反复复,因此写一篇经验分享,希望能记录一下自己的过程,也能给其他人一些帮助(可以在评论区讨论),提醒一下,一定要写一些声明,不会写、不知道写啥就看第四章的第二个问题。

weixin_55988068的博客 1万+

user is not in the sudoers file.This incident will be reported

user is not in the sudoers file.This incident will be reported 新建的用户(user)切换权限时出现这个错误 解决方法 1.先关机切换到之前的用户登录,再切换到root权限 sudo -s 2.添加sudoers文件权限 chmod u+x /etc/sudoers 3.编辑sudoers文件 gedit /etc/sudoers 在r...

weixin_45208598的博客 3252

WSL2离线安装Ubuntu终极指南:绕过Microsoft Store慢速下载(附最新22.04 LTS离线包)

本文提供WSL2离线安装Ubuntu 22.04 LTS的完整指南,帮助开发者绕过Microsoft Store下载慢的问题。通过PowerShell命令配置环境、获取离线安装包并完成安装,同时包含初始配置、资源优化及常见问题解决方案,助您快速搭建高效的Linux开发环境。

c8d9e0f1的博客 910

[已解决]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. 今天在学习的时候,不小心把自己的用户sudo玩坏了(Broken sudo),于是上谷歌搜索XXX is not in the sudoers file. This incident will be reported. 看到一些大多数...

Moelimoe的博客 8万+

从零开始安装pytorch(包含GPU和CPU版本的安装)

Pytorch是。

qiaoxinyu1989的博客 8万+

Unity 佳能SDK 及数据获取

3. 把CameraControl 下面只要是绿色的 .cs 文件都复制到Unity 中。1. 填写信息跟官方申请SDK,大概1-2个工作日会邮件回复你。2. 将SDK这两个文件放到 Unity Plugins文件夹。

我知道你很急,但是路要一步步走 1481

Ubuntu user is not in the sudoers file. This incident will be reported解决办法

Ubuntu user is not in the sudoers file. This incident will be reported解决办法

weixin_47540149的博客 5644

cartographer ceres后端优化

这里引用一篇文章作用一:用户可以选择使用Problem::AddParameterBlock显式添加参数块;在显式添加的时候ceres会内部进行额外的正确性检查。当Problem::AddParameterBlock()不存在时,Problem::AddResidualBlock()会隐式添加参数块,因此不需要显式调用Problem::AddParameterBlock()函数。ps:类似构造函数,显式构造函数。

南北粉面馆 806

Ubuntu 报错 “user is not in the sudoers file” 的原因与解决方法

当 Ubuntu 用户执行 sudo 命令提示“用户不在 sudoers 文件中”时,说明该用户无管理员权限。解决方法包括:使用 root 用户将其添加到 sudo 用户组,或通过 visudo 手动授予权限。如果无 root 权限,可通过恢复模式进入系统,修复用户权限配置。操作后需重启或重新登录才能生效。

qq_37519605的博客 2924

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Linux报“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”错误; 解决方法就是在/etc/sudoers文件里给该用户添加权限。如下:1.切换到root用户下# su2./etc/sudoers文件默认是只读的,对root来说也是,因此需先添加sudoers文件的写权限,命令是:# chm

哎!小本本上八卦羞答答,人生太复杂... 2951

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

解决 ‘Username Is Not in the Sudoers File. This Incident Will Be Reported’

在使用sudo命令提示标题错误,下面介绍两种方法,第一种方法试过不行,我是使用第二种方法解决的1.使用指令 sudo adduser vboxuser sudo 恢复2.将用户名添加到sudoers文件。

weixin_60062799的博客 1238

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

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

Ubuntu版本,在一般用户下执行sudo命令提示user is not in the sudoers file. This incident will be reported.解决方法: 一、$where is sudoers -------找出文件所在的位置,默认都是/etc/sudoers 二、#chmod u+w /etc/sudoer...

一路奔跑94的博客 6054

【简单易懂】user is not in the sudoers file. This incident will be reported.(Centos系统)

【简单易懂】user is not in the sudoers file. This incident will be reported.(centos系统)。如果你有更好的方法,欢迎在评论区讨论交流。如果你感觉这篇文章有用,点赞收藏评论。

jupangMZ的博客 1445

git is not in the sudoers file.This incident will be reported

解决方法如下: 1>、进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。 2>、添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。 3>、编辑/etc/sudoers文件。也就是输入命令"vim /etc/sudoers",输入"i"进入编辑模式,找到这一行:"root ALL=(ALL)

macallbobo的专栏 1512

用户 is not in the sudoers file. This incident will be reported解决办法

命令(推荐,自动检查语法)或。:切换回用户user,测试。

weixin_69074912的博客 552

User not in the sudoers file. This incident will be reported

在Ubuntu 中使用sudo 时,会发现提示 User not in the sudoers file. This incident will be reported 这样的错误,你可以修改/etc/sudoers下面的这个文件,把当前用户添加到里面,这是一种修改 办法。 还有一个办法是使用下面的命令: id  user_name 查看以下当前用户所属

xiaoshang的专栏 779

【已解决】user is not in the sudoers file. This incident will be reported.

(我输入的密码是第一次安装Linux时的密码,如果不成功,就把你在Linux中所有用户的密码都输入一遍)然后就OK了,成功切换到root用户。

super123321lu的博客 407

Fedora提示 xxxis not in the sudoers file.this incident will be reported解决办法

由于Fedora默认不添加用户到sudoers,因此当我们使用sudo时就会出现“is not in the sudoers file.”的错误。 添加方法如下: 1.进入root模式 su -  注意:su和-之间有空格 输入当前用户的密码 2.添加写权限 chmod u+w /etc/sudoers 3.将自己加入到sudoers中 gedit /etc

firefoxbug的专栏 1512

#user is not in the sudoers file . This incident will be reported

看提示 应该是 sudoers file文件里面缺少 #user用户 所以寻找sudoers 文件添加用户 打开文件 [root@localhost innjia]# chmod u+w /etc/sudoers [root@localhost innjia]# vim  /etc/sudoers 添加用户 1:切换到超级用户 [nnjia@localhost

静下心来写代码 750

CentOS7 'Username' is not in the sudoers file. This incident will be reported

新装的 CentOS 需要安装许多软件,但是如果一开始你不是以 root 登入的话,就需要使用 sudo 进行切换,但是通常会报错如下图: 解决方法: 先用 root 用户登入系统, 打开文件 vi /etc/sudoers 将用户名称添加到文件中 user_name ALL=(ALL) ALL 转载于:https://www.cnblogs.com...

weixin_33739627的博客 465
上一篇: vue-cli 项目 webpack.prod.conf.js 文件代码注释
下一篇: pycharm 更新 pip 报 UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 错误已经解决
vcfriend
博客等级 码龄23年 71粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值