ubuntu下执行sudo命令提示:xx is not in the sudoers file. This incident will be reported.
在执行sudo命令时会有如下提示:
xx is not in the sudoers file. This incident will be reported.
原因分析:一般这种情况是修改了用户名,没有对应修改sudoers文件或者group文件。
解决方法:
方法1:
如果除了root用户,还有别的用户,可以切换到别的用户,然后切换到root用户下,修改sudoers文件。
执行visudo命令,vi和sudo之间没有空格。或者vi /etc/sudoers 命令,增加用户。
方法2:
使用 su -命令(有空格,用"su"命令只是切换到root,而没有把root的环境变量传过去,实际是当前用户的环境变量,用"su -"命令会将环境变量传过去,和root登录效果一样),然后修改sudoers文件即可(visudo)。如果出现如下情况,别慌,只需要先进入recovery mode,然后修改sudoers文件即可。
ubuntu进入recovery mode请参考: recovery mode
注:
username ALL=(ALL:ALL) ALL #用户需要输入密码执行sudo命令
%groupname ALL=(ALL) AL #用户组里的用户输入密码执行sudo命令
username ALL=(ALL) NOPASSWD: ALL #用户免密执行sudo命令
%groupname ALL=(ALL) NOPASSWD: ALL #用户组里的用户andy免密执行sudo命令
ubuntu下执行sudo命令提示:xx is not in the sudoers file. This incident will be reported.相关推荐
- centos/Linux 解决使用sudo命令时xxx is not in the sudoers file.This incident will be reported
解决方法 切换到root用户: su 然后在root用户下输入命令: chmod u+w /etc/sudoers vim /etc/sudoers 在vim编辑器界面输入/root查询到这一行: r ...
- 解决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 ...
- 【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 ...
- 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"错误,解决 ...
- Hadoop之——Linux下sudo命令报错:hadoop is not in the sudoers file. This incident will be reported.
转载请注明出处:https://blog.csdn.net/l1028386804/article/details/93380235 当在终端执行sudo命令时,系统提示"cuser is ...
- sudo 执行报错centos is not in the sudoers file. This incident will be reported.
执行sudo -i,提示如下信息 [centos@localhost ~]$ sudo -i [sudo] password for centos: centos is not in the sud ...
- Linux中新建用户用不了sudo命令问题:rootr is not in the sudoers file.This incident will be reported解决
Linux中新建用户用不了sudo命令问题:rootr is not in the sudoers file.This incident will be reported解决 参考:https://b ...
- How to Fix “Username is not in the sudoers file. This incident will be reported” in Ubuntu
How to Fix "Username is not in the sudoers file. This incident will be reported" in Ubuntu ...
- ubuntu下执行sudo apt-get install python-pip 出现错误 Unable to locate package python-pip
ubuntu13.04下执行sudo apt-get install python-pip 出现以下错误: E: Unable to locate package python-pip 解决办法: 摘 ...
最新文章
- 基于前后端分离的Nginx+Tomcat动静分离
- gin的Bindxxx和ShouldBindxxx的区别
- 寻找第k大的元素Java,java – 支持快速第k个最大元素查找的队列数据结构
- 《Dotnet9》系列-Google ProtoBuf在C#中的简单应用
- 认知智能,AI 的下一个十年 | AI Procon 2020
- 前端开发 V8引擎是什么?
- layui,返回的数据不符合规范,正确的成功状态码 (code) 应为:0
- 三次hermite插值多项式例题_数值分析实验六(分段三次Hermite插值)
- 2020编程入门先学什么
- iTunes备份文件路径修改方法
- graphpad导出图片不居中_Graphpad如何导出期刊所需图
- Photoshop十种抠图方法
- springboot项目结构_从零搭建Spring Boot脚手架(1):开篇以及技术选型
- 使用jbe修改jar中class中的内容
- VIPKID壁垒破碎:境外外教课包将下线,核心竞争力消失?
- Git如何生成SSH密钥
- 网络配置中rc.d-rc6.d的说明
- andorid Telephony 整体介绍
- 时间单位:s cs ms us ns ps fs as zs js ys 普朗克
- 得移动互联网者得天下