Ubuntu下普通用户用sudo执行命令时报如题所示错误,解决方法就是在/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.This incident will be reported" 错误解决方法的更多相关文章

  1. 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 ...

  2. 企业运维案例:xxx is not in the sudoers file.This incident will be reported” 错误解决方法

    CentOS6系统下,普通用户使用sudo执行命令时报错: xxx is not in the sudoers file.This incident will be reported" 解决 ...

  3. centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法

    修改主机名:vim /etc/sysconfig/network 1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 # ...

  4. sudo 提示 'xxx is not in the sudoers file.This incident will be reported.的解决方法'

    在使用 Linux 的过程中,有时候需要临时获取 root 权限来执行命令时,一般通过在命令前添加 sudo 来解决. 但是第一次使用 sudo 时,有可能会得到这样一个错误提示 xxx is not ...

  5. 解决: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 ...

  6. xxx is not in the sudoers file.This incident will be reported.的解决方法 (一般用户不能执行sudo)

    1.切换到root用户下 2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件vi /etc/sudoers找到这行 root ALL=(AL ...

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

    1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去. 2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件vi /etc/sud ...

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

    1>.进入超级用户模式.也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式.(当然,你也可以直接用root用户登录,因为红旗安装过后默认的登录 ...

  9. 普通用户开通sudo权限:xxx is not in the sudoers file.This incident will be reported.的解决方法

    1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去. 2.添加sudo文件的写权限,命令是: chmod u+w /etc/sudoers 3.编辑sudoers文件 vi /etc/s ...

随机推荐

  1. Windows平台下安装Hadoop

    今天参照这个网址(http://www.cnblogs.com/kinglau/archive/2013/08/20/3270160.html)安装了下,前面七步没有问题. 到第八步出问题了,后来看了 ...

  2. MyBatis学习--查询缓存

    简介 以前在使用Hibernate的时候知道其有一级缓存和二级缓存,限制ORM框架的发展都是互相吸收其他框架的优点,在Hibernate中也有一级缓存和二级缓存,用于减轻数据压力,提高数据库性能. m ...

  3. 跨浏览器图像灰度(grayscale)解决方案

    <style type="text/css"> .gray { -webkit-filter: grayscale(100%); /* CSS3 filter方式,we ...

  4. android-之测试框架的使用AndroidTestCase

    Android Manifest.xml中所需要添加的配置 <instrumentation android:name="android.test.InstrumentationTes ...

  5. Java垃圾收集算法介绍

    垃圾回收器GC(Garbage Collection) 一.引用计数算法(Reference Counting) 介绍:给对象添加一个引用计数器,每当一个地方引用它时,数据器加1:当引用失效时,计数器 ...

  6. Jenkins_获取源码编译并启动服务(一)

    一.安装Jenkins插件(可以手动安装,使用推荐安装容易卡死) 系统管理-->插件管理-->可选插件 Folders Plugin OWASP Markup Formatter Plug ...

  7. 网络流 poj 3308 最小割

    t个样例 n*m的矩阵 L个伞兵 给出每行每列装激光的花费 伞兵的位置 要求杀死所有伞兵 总费用为这些费用的乘积  求花费最小 建图  源点 ->   行   -> 列  -> 汇点 ...

  8. CSS强制英文、中文换行与不换行 强制英文换行

    1. word-break:break-all;只对英文起作用,以字母作为换行依据 2. word-wrap:break-word; 只对英文起作用,以单词作为换行依据 3. white-space: ...

  9. IE6、IE7、IE8的CSS、JS兼容

    Internet Explorer 6中查看使用 Microsoft JScript 的网页,可能会遇到web浏览器速度较慢的性能问题.原因是如果js脚本同时创建大量变量,jscript引擎执行垃圾收 ...

  10. MySQL忘记密码的解决方法

    1.关闭正在运行的MySQL. 2.打开DOS窗口,转到mysql\bin目录. 3.输入mysqld --skip-grant-tables回车. 4.原窗口已经不动了,再开一个DOS窗口,转到my ...