【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. ubuntu14.04下开启ssh服务

    1. 安装 sudo apt-get update sudo apt-get install openssh-server 2.开启服务 查看查看ssh服务是否启动 打开"终端窗口" ...

  2. IAM:亚马逊访问权限控制

    IAM的策略.用户->服务器(仓库.业务体) IAM:亚马逊访问权限控制(AWS Identity and Access Management )IAM使您能够安全地控制用户对 AWS 服务和资 ...

  3. 接口测试工具-Jmeter使用笔记(五:正则表达式提取器)

    (正则表达式提取器是Jmeter关联中的一种)使用场景: 有两个HTTP请求,请求A的返回数据中有一个字段“ABCD”,该字段要作为请求B的入参. 1.添加方式 请求A上右键-->后置处理器-& ...

  4. 一个canonical标签解决site不在首页的问题

    前段时间因为竞价的同事为了方便查看转化路径,在每个关键词都设置了不同的url,具体是直接在标准网址后面加#和参数,例如www.abc.com/#defgh,www.abc.com/#ijklmn,因为 ...

  5. OC侧滑删除

    做侧滑的时候发现一个问题,当一个UITableView的cell有的有侧滑,有的没有,当用editActionsForRowAtIndexPath方法的时候发现有点问题,查看了下api,需要用到can ...

  6. 003-docker命令-远程镜像仓库命令,本地镜像管理命令

    1.远程镜像仓库 docker login/logout:查看 [不常用] docker push:查看 [不常用] docker search:从Docker Hub查找镜像 语法:docker s ...

  7. 001-mock.js安装使用

    一.基础 1.1.安装 //安装 npm install mockjs --save 1.2.使用 // 使用 Mock var Mock = require('mockjs') Mock.mock( ...

  8. .Net 学习过程

    1.C#面向过程编程. 2.C#面向对象基础. 3.WPF教程. 4.SQL语句. 5.ADO.Net. 6.HTML.JavaScript.Dom. 7.ASP.Net.

  9. react 首页加载loading

    首页加载loading,放在#root里面,代码如下: <!DOCTYPE html> <html lang="en"> <head> < ...

  10. vue-自定义全局键盘码

    1.Vue.config.keyCodes.enter=13; //main.js中定义全局 <template> <div> <input v-model=" ...