【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. 几种Linux 查询外网出口IP的方法(转)

    原文:http://www.cnblogs.com/wudonghang/p/354289a61129731e7d2075968356e6ad.html Curl 纯文本格式输出: curl ican ...

  2. es6 学习四 数组的学习

    1. Array.from() 语法: Array.from(arrayLike[, mapFn[, thisArg]]) arrayLike 类数组对象 mapFn 如果指定了该参数,新数组中的每个 ...

  3. Ubuntu上qt环境的构建

    写在前面.......这个教程好像比较早一点了,现在介绍一个新的思路: 整体参见如下步骤(for zedboard): 1.首先下载qt-opensource-linux.run文件,然后跟在Wind ...

  4. @property专题

    “属性” (property)作为 Objective-C 的一项特性,主要的作用就在于封装对象中的数据. Objective-C 对象通常会把其所需要的数据保存为各种实例变量.实例变量一般通过“存取 ...

  5. 30个redis.conf 配置项说明

    redis.conf 配置项说明如下: 1. Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程 daemonize no 2. 当Redis以守护进程方式运行时,R ...

  6. 执行hadoop自带的WordCount实例

    hadoop 自带的WordCount实例可以统计一批文本文件中各单词出现的次数.下面介绍如何执行WordCount实例. 1.启动hadoop [root@hadoop ~]# start-all. ...

  7. 小程序编辑器vscode

    安装中文版 1)打开vscode工具: 2)使用快捷键组合[Ctrl+Shift+p],在搜索框中输入“configure display language”,点击确定后: 3)如图所示 =>安 ...

  8. os.path.join路径拼接

    #import os print("0:", os.path.join('/aaa', 'bbb', 'ccc.txt')) #0: /aaa\bbb\ccc.txt 多数这种用法 ...

  9. Dell服务器Raid5之后安装系统

    在做raid之后,安装系统.竟然安装不成功! 百度之后,发现第一启动项是raid的硬盘,不是我本机的ssd. 报错如下: 启动机器F2—boot setting 如果引导模式是UEFI 换成了bios ...

  10. BI-LSTM and CRF using Keras

    问题1:CUDA_ERROR_OUT_OF_MEMORY: How to activate multiple GPUs from Keras in Tensorflow import keras.ba ...