当前位置:网站首页>xxx is not in the sudoers file.This incident will be reported错误
xxx is not in the sudoers file.This incident will be reported错误
2022-07-30 05:46:00 【一只积极向上的小咸鱼】
一 问题解决
在执行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 root 用户切换到普通用户_Mar.三月的博客-CSDN博客_root切换到普通用户)
1. 普通用户切换至root用户
1、按上su,然后按照提示输入相应的root密码,就可登录到root权限下。
2、按上sudo su,然后按照提示输入相应的root密码,就可登录到root权限下(这个命令下,一般不需要输入相应的root密码)。
3、按上su root,然后按照提示输入相应的root密码,就可登录到root权限下
2. root用户切回普通用户
1、只需执行命令:su user (user是你自己安装时候的用户名),
2、直接输入exit,
3、Ctrl+D组合键退出
如何给root用户设定密码:
只需执行命令:sudo passwd root然后根据提示一步一步来。
边栏推荐
- antd table Summary总结栏置顶
- Diwen serial screen production (serialization 1) ===== preparation work
- 【江科大自化协stm32F103c8t6】笔记之【入门32单片机及GPIO初始化参数配置】
- UAV ecological environment monitoring, image processing and GIS data analysis
- Duplicate keys detected:‘/da…‘
- Simulation of Future Air Pollution Changes Based on Global Model Comparison Program CMIP6 and Regional Climate-Chemistry Coupling Model WRF-Chem
- Anaconda 安装低版本tensorflow
- ipconfig命令指南
- 边境的悍匪—机器学习实战:第十三章 使用TensorFlow加载和预处理数据
- 闭包(你不知道的JS)
猜你喜欢

QT Weekly Skills (1) ~~~~~~~~~ Running Icon

【markdown常用用法】

Configure MMdetection environment and train

Cannnot download sources不能下载源码百分百超详细解决方案

R language application in the field of ecological environment

Self-augmented Unpaired Image Dehazing via Density and Depth Decomposition program running record

点云统计滤波理解
![[Jiangsu University of Science and Technology Automation Association stm32F103c8t6] Notes [Initial 32 MCU and TIM timing interrupt initialization parameter configuration]](/img/22/9c0dd4390a98fa2aa4e45164c078cc.png)
[Jiangsu University of Science and Technology Automation Association stm32F103c8t6] Notes [Initial 32 MCU and TIM timing interrupt initialization parameter configuration]

Target detection, object classification and semantic segmentation of UAV remote sensing images based on PyTorch deep learning

QT serial 3: LORA test platform based on QT and STM32H750 (2)
随机推荐
Sklearn : train_test_split()函数的用法
R language application in the field of ecological environment
电子工程师怎么才能规范设计标准、提高设计效率?
Rsync realizes folder or data synchronization between Win systems
闭包和作用域(你不知道的JS自用笔记)
Basic application of XMLBean
暂时存着阿里云
租用服务器训练yolov3模型
FPGA解析B码----连载1
【江科大自化协stm32F103c8t6】笔记之【入门32单片机及利用TIM输出比较配置PWM】
>>> /deep/ ::v-deep 深度作用选择器
Antd简单启动一个企业级项目
基于OpenCV的双目重建
Diwen serial screen production (serialization 1) ===== preparation work
无法完成包的安装npm ERR! Refusing to install package with name “moment“ under a package also called “moment“
Kunlun State Screen Production (Serialization 5) --- Basics (serial port reception, text and light display)
边境的悍匪—机器学习实战:第五章 支持向量机
CPU缓存一致性问题
QT连载2:基于QT和STM32H750的LORA试验平台(1)
UAV ecological environment monitoring, image processing and GIS data analysis