ubuntu:xxx is not in the sudoers file. 问题解决
ubuntu 下普通用户用 sudo 执行命令时报 "xxx is not in the sudoers file.This incident will be reported" 错误,解决方法是在 /etc/sudoers 文件里给该用户添加权限。操作过程如下:
1. 切换到 root 用户下
2. /etc/sudoers 文件默认是只读的,对 root 来说也是,因此需先添加 sudoers 文件的写权限,命令是:
chmod u+w /etc/sudoers
3. 编辑 sudoers 文件
vi /etc/sudoers
找到这行 root ALL=(ALL) ALL,在他下面添加
xxx ALL=(ALL) ALL (这里的 xxx 是你的用户名)
PS:这里说下你可以 sudoers 添加下面四行中任意一条
/*******************************************/
youuser ALL=(ALL) ALL
%youuser ALL=(ALL) ALL
youuser ALL=(ALL) NOPASSWD: ALL
%youuser ALL=(ALL) NOPASSWD: ALL
第一行:允许用户 youuser 执行 sudo 命令(需要输入密码)。
第二行:允许用户组 youuser 里面的用户执行 sudo 命令(需要输入密码)。
第三行:允许用户 youuser 执行 sudo 命令,并且在执行的时候不输入密码。
第四行:允许用户组 youuser 里面的用户执行 sudo 命令,并且在执行的时候不输入密码。
/*******************************************/
4.撤销 sudoers 文件写权限,命令:
chmod u-w /etc/sudoers
ubuntu:xxx is not in the sudoers file. 问题解决的更多相关文章
- Ubuntu下is not in the sudoers file 问题解决
在Ubuntu12.04 下,使用sudo apt-get install XXX 时,突然跳出 username is not in the sudoers file的问题 然后我一查此userna ...
- Ubuntu——"xxx is not in the sudoers file.This incident will be reported" 错误解决方法
Ubuntu下普通用户用sudo执行命令时报如题所示错误,解决方法就是在/etc/sudoers文件里给该用户添加权限.如下: 1.切换到root用户下 2./etc/sudoers文件默认是只读的, ...
- Linux遇到的问题(一)Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法
提示错误信息 www@iZ236j3sofdZ:~$ ifconfig Command 'ifconfig' is available in '/sbin/ifconfig' The command ...
- centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法
修改主机名:vim /etc/sysconfig/network 1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 # ...
- Error prompt:“xxx is not in the sudoers file”----Solution
//Situation System prompts "xxx is not in the sudoers file"(xxx equals the user name) w ...
- Linux中添加管理员权限问题:xxx is not in the sudoers file. This incident will be reported.
在各个不同版本的linux中添加拥有管理员权限账户有不同的简便方式. 问题: 今天遇见将新添用户添加到root用户组后,运行sudo仍然提示 ”xxx is not in the sudoers fi ...
- CentOS7──xxx is not in the sudoers file
提示"xxx is not in the sudoers file. This incident will be reported.其中 ”XXX“是你的用户名,也就是你的用户名没有权限使用 ...
- Linux sudo 错误:XXX is not in the sudoers file 解决办法
最近在学习linux,在某个用户(xxx)下使用sudo的时候,提示以下错误:xxx is not in the sudoers file. This incident will be reporte ...
- 解决: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/s ...
随机推荐
- 关于Python元祖,列表,字典,集合的比较
定义 方法 列表 可以包含不同类型的对象,可以增减元素,可以跟其他的列表结合或者把一个列表拆分,用[]来定义的 eg:aList=[123,'abc',4.56,['inner','list'], ...
- CentOS DesktopEntry
IBM Developer : https://www.ibm.com/developerworks/cn/linux/l-cn-dtef/index.html [Desktop Entry] N ...
- typeof和instansof的区别
typeof typeof 是一个一元运算,放在一个运算数之前,运算数可以是任意类型. 它返回值是一个字符串,该字符串说明运算数的类型.(typeof 运算符返回一个用来表示表达式的数据类型的字符串. ...
- css 滚动视差 之 水波纹效果
核心属性: background-attachment 这个属性就牛逼了, 它可以定义背景图片是相对视口固定, 还是随着视口滚动, 加上这个属性网页瞬间就从屌丝变成 高大上. 我们来看个例子: htm ...
- 解决:git push error: failed to push some refs to
出现错误的原因是github中的README.md文件不在本地代码目录中. 也就是说我们需要先将远程代码库中的任何文件先pull到本地代码库中,才能push新的代码到github代码库中. 使用如下命 ...
- 带着新人看java虚拟机06(多线程篇)
其实多线程还有很多的东西要说,我们慢慢来,可能会有一些东西没说到,那就没办法了,只能说尽量吧! 1.synchronized关键字 说到多线程肯定离不开这个关键字,为什么呢?因为多线程之间虽然有各自的 ...
- WebSocket协议详解与c++&c#实现
摘要: 随着手机游戏.H5游戏以及微信小游戏的普及,越来越多的客户端-服务器端的通讯采用websocket协议.Websocket协议是全双工的.基于数据帧的.建立在tcp之上的长连接协议.Webso ...
- LDA && NCA: 降维与度量学习
已迁移到我新博客,阅读体验更佳LDA && NCA: 降维与度量学习 代码实现放在我的github上:click me 一.Linear Discriminant Analysis(L ...
- C++删除文件末尾字符
C++中使用fstream来进行文件读写,如果要覆盖文件末尾的部分字符,应该怎么操作呢? #include <iostream> #include <fstream> std: ...
- 面向对象之三个基本特征(javaScript)
1. 前言 2. 封装 3. 继承 4. 多态 5. 总结 1. 前言 了解过面向对象的同学应该都知道,面向对象三个基本特征是:封装.继承.多态,但是对于这三个词具体可能不太了解. 2. 封装 在说封 ...