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 ...
随机推荐
- BZOJ_2073_[POI2004]PRZ_状压DP
BZOJ_2073_[POI2004]PRZ_状压DP 题意: 一只队伍在爬山时碰到了雪崩,他们在逃跑时遇到了一座桥,他们要尽快的过桥. 桥已经很旧了, 所以它不能承受太重的东西. 任何时候队伍在桥上 ...
- 【Unity游戏开发】Lua中的os.date和os.time函数
一.简介 最近马三在工作中经常使用到了lua 中的 os.date( ) 和 os.time( )函数,不过使用的时候都是不得其解,一般都是看项目里面怎么用,然后我就模仿写一下.今天正好稍微有点空闲时 ...
- 从Java继承类的重名static函数浅谈解析调用与分派
在java中,static成员函数是否可以被重写呢? 结论是,你可以在子类中重写一个static函数,但是这个函数并不能像正常的非static函数那样运行. 也就是说,虽然你可以定义一个重写函数,但是 ...
- MYSQL—— 基础入门,增、删、改、查(基础篇)
首先呢,先解释一下基本的概念,心里最起码知道就ok啦!其余更多的了解,得另查看喽! (1)什么是sql? sql:指结构化查询语言,有能力访问数据库,是一种ANSI(美国国家标准话组织)的标准计算机语 ...
- Mybaits-plus实战(三)
1. Mybaits-plus实战(三) 1.1. 特殊使用规则 1.1.1. Model逻辑删除 数据库对应实体类,继承Model类可以实现AR模式的sql语句操作,但这里需要注意的是,对逻辑删除, ...
- python enumerate() 函数的使用方法
列表是最常用的Python数据类型,前段时间看书的时候,发现了enumerate() 函数非常实用,因为才知道下标可以这么容易的使用,总结一下. class enumerate(object): &q ...
- 约定Service构建方式
对于DevOps中,将开发好的软件交付给运维人员去部署与维护,过程中参杂着诸多不可控制的变量,如环境问题.版本问题等等,而Docker容器极大程度上解决了这些问题,同时对于服务的持续交付,也变得方便和 ...
- Postgre Sql获取最近一周、一月、一年日期函数
使用Postgre Sql获取近一周.一年.一月等系统函数调用如下,使用方面相对于Ms Sql server 容易了许多. --当前时间 select now(); --current_timesta ...
- HTML 练习清除浮动 :after
为 clearfix 类所在的 div 内部最后处添加一个 div 标签,内容为 . ,高度为0, 隐藏 <!DOCTYPE html> <html lang="en&qu ...
- 轻松搞定表白女朋友:Android版APP (零基础也可直接下载软件)
在我们平时生活当中,经常会看到一些表白女朋友的html网页,但是Android端的表白软件可以说是基本没有,笔者在全网搜了一下,就没有一个可以用的.安卓端可以给人一种定制和精美的感觉,这是网页所做不到 ...