UBuntu sudo 命令 :xxx is not in the sudoers file. This incident will be reported.
【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.的更多相关文章
- sudo 提示 'xxx is not in the sudoers file.This incident will be reported.的解决方法'
在使用 Linux 的过程中,有时候需要临时获取 root 权限来执行命令时,一般通过在命令前添加 sudo 来解决. 但是第一次使用 sudo 时,有可能会得到这样一个错误提示 xxx is not ...
- 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的用户 # ...
- Linux中添加管理员权限问题:xxx is not in the sudoers file. This incident will be reported.
在各个不同版本的linux中添加拥有管理员权限账户有不同的简便方式. 问题: 今天遇见将新添用户添加到root用户组后,运行sudo仍然提示 ”xxx is not in the sudoers fi ...
- 解决: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 ...
- 企业运维案例: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" 解决 ...
- XXX is not in the sudoers file. This incident will be reported 的问题解决方案
不多说,直接上干货! 说的是,这种问题,是出现在ubuntu系统里. root@SparkSingleNode:/usr/local/jdk# pwd /usr/local/jdk root@Spar ...
- Ubuntu——"xxx is not in the sudoers file.This incident will be reported" 错误解决方法
Ubuntu下普通用户用sudo执行命令时报如题所示错误,解决方法就是在/etc/sudoers文件里给该用户添加权限.如下: 1.切换到root用户下 2./etc/sudoers文件默认是只读的, ...
- 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 ...
随机推荐
- RequireJs的理解
什么是RequireJs RequireJS 是一个JavaScript模块加载器. 在ES6出现之前,JS不像其他语言同样拥有“模块”这一概念,于是为了支持JS模块化,出现了各种各样的语言工具,如w ...
- 【Python学习 】Python获取命令行参数的方法
背景 最近编写一个python程序的时候,需要去获取python命令行的参数,因此这里记录下如何获取命令行参数的方法. 一.sys 模块 在 Python 中,sys 模块是一个非常常用且十分重要的模 ...
- 在Windows Server 2008 R2 Server中,上传视频遇到的问题(二)
上一篇 在Windows Server 2008 R2 Server中,上传视频遇到的问题(一)中遇到上传40M视频报404,然后修改配置文件节点: <httpRuntime targetFr ...
- react native touchable
<Button style={{marginTop: 30}} onPress={() => { Alert.alert("你点击了按钮!"); }} onPressI ...
- Python-多线程.md
# 环境 - xubuntu 16.04 - anaconda - pycharm - python3.6 - https://www.cnblogs.com/jokerbj/p/7460260.ht ...
- 微信公众号支付开发当前URL未注册解决办法
微信公众号支付,则需要现在微信支付商户后台,预先添加支付网址才可以.否则会出现“当前URL未注册”字样的报错. 方法/步骤 1. 报错实例如下,手机端微信调起微信支付框时弹出 2. 首先需要登录微信支 ...
- Eclipse中git上如何把自己的分支保存到远端
1 Team——>remote——>push 2 next 3 选择自己的分支,然后点击 Add Spec 4 查看是否是自己的分支——>自己的分支,然后Finish PS ...
- 【Python】-NO.98.Note.3.Python -【Python3 解释器、运算符】
1.0.0 Summary Tittle:[Python]-NO.98.Note.3.Python -[Python3 解释器] Style:Python Series:Python Since:20 ...
- Apache与Tomcat整合的配置
下载jk连接器地址:http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/ 把jk连接器即“mod_j ...
- js函数定义的三种方式
1.函数声明语法 function sum(num1, num2){ return num1 + num2; } 2.函数表达式定义 var sum = function (num1, num2){ ...