【1】分析问题

提示内容翻译成中文即:用户XXX(一般是新添加的用户名称)没有权限使用sudo。

解决方法修改新用户的权限,具体操作即修改一下/etc/sudoers文件。

【2】切换至root用户模式

命令:su -

备注:这里命令加有"-" ,与su是不同的。

在用命令"su"时只是切换到root,但没把root的环境变量传过去,还是当前用户的环境变量。

而用"su -"命令会将环境变量也一起切换过去(可以亲测,两个命令后分别查看环境变量$PATH),就像是root登录一样。

【3】修改文件的写权限

命令:chmod u+w /etc/sudoers

【4】编辑文件内容

命令:gedit /etc/sudoers

打开文件后,查找 root ALL=(ALL) ALL 这行

在此行下面添加一行:

XXX ALL=(ALL) ALL

其中,XXX就是用户名。记得要保存。

【5】撤销文件的写权限

命令:chmod u-w /etc/sudoers

【6】验证问题。切换到用户XXX

命令:su XXX

输入用户对应的登陆密码。

sudo命令可以正常使用。

Good Good Study,Day Day Up.

顺序 选择 循环 总结

UBuntu sudo 命令 :xxx is not in the sudoers file. This incident will be reported.的更多相关文章

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

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

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

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

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

  4. Linux中添加管理员权限问题:xxx is not in the sudoers file. This incident will be reported.

    在各个不同版本的linux中添加拥有管理员权限账户有不同的简便方式. 问题: 今天遇见将新添用户添加到root用户组后,运行sudo仍然提示 ”xxx is not in the sudoers fi ...

  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” 错误解决方法

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

  7. XXX is not in the sudoers file. This incident will be reported 的问题解决方案

    不多说,直接上干货! 说的是,这种问题,是出现在ubuntu系统里. root@SparkSingleNode:/usr/local/jdk# pwd /usr/local/jdk root@Spar ...

  8. Ubuntu——"xxx is not in the sudoers file.This incident will be reported" 错误解决方法

    Ubuntu下普通用户用sudo执行命令时报如题所示错误,解决方法就是在/etc/sudoers文件里给该用户添加权限.如下: 1.切换到root用户下 2./etc/sudoers文件默认是只读的, ...

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

随机推荐

  1. window 系统显示svg、psd格式文件

    可以安装SVG Explorer Extension来预览略缩图原地址:https://svgextension.codeplex.com 参考地址 github上 exe 文件下载地址 https: ...

  2. myeclipse项目导入到eclipse, HttpServletRequest报红现象

    eclipse项目中关于导入的项目里提示HttpServletRequest 不能引用的解决办法 当使用eclipse导入外部的web工程时,有时会提示HttpServletRequest, Serv ...

  3. CSS中position属性介绍(新增sticky)

    position的含义是指定类型,取值类型可以有:static.relative.absolute.fixed.inherit 和 sticky,这里sticky是CSS3新发布的一个属性. 1.po ...

  4. Jenkins打包安卓时提示没同意constraintLayout的license的解决方法

    使用Jenkins打包安卓项目时,报错并失败,错误信息: You have not accepted the license agreements of the following SDK compo ...

  5. MySQL数据库改名的三种方法

    前不久去面试,被问到Innodb引擎的表如何改数据库名,当时我也只回答了MyISAM改如何操作,被一些细节问题打败,真是操蛋. 如果表示MyISAM那么可以直接去到数据库目录mv就可以. Innodb ...

  6. 前端 HTML body标签相关内容 常用标签 表格标签 table

    表格标签 table 表格由<table> 标签来定义.每个表格均有若干行(由 <tr> 标签定义),每行被分割为若干单元格(由<td>标签定义).字母 td 指表 ...

  7. HTN规划 jshop2

    http://www.cs.umd.edu/projects/shop/description.html 在HTN规划,规划体系从世界的初始状态和创建一个计划来执行一系列任务的目的(需要做的事情,抽象 ...

  8. Python3学习之路~2.9 字符编码与转码

    详细文章: http://www.cnblogs.com/yuanchenqi/articles/5956943.html http://www.diveintopython3.net/strings ...

  9. 005-优化web请求一-gzip压缩、http缓存控制和缓存校验[Pragma、Expires、Cache-Control、max-age、Last-Modified、用户刷新访问、避免过度304]

    优化Web应用的典型技术:缓存控制头信息.Gzip.应用缓存.ETag.反应型技术[异步方法调用和WebSocket] 一.模板缓存 spring.thymeleaf.cache=true sprin ...

  10. wx工具栏,菜单栏,状态栏

    #!/usr/bin/env python # -*- coding: utf- -*- import wx import wx.py.images class ToolbarFrame(wx.Fra ...