解决ubuntu系统“XXX is not in the sudoers file”错误
用adduser新建的用户,当时只输入了一个用户名,没做其它操作,这样就建立了一个normal用户。在执行sudo vim hadoop-env.sh时,报“*** is not in the sudoers file. This incident will be reported.”。
经查询,网上的解决方案大多数都是:
执行visudo或vim /etc/sudoers命令,然后在root用户下面增加<username> ALL=(ALL) ALL
我相信这样一定可以解决问题,但这是杀鸡用牛刀。看起来似乎是让这个用户和root一样拥有了全部全部全部的权限,有没有感觉瑟瑟发抖。像这样的方法,我们自己使用玩玩还可以,但这肯定不是正确的解决方法。更何况,在安装系统时建立的一个用户hadoop1,可以使用sudo,但这个用户名并不在sudoers 这个文件里,所以肯定有其它正确的方法。
后来在这里https://www.cnblogs.com/yadongliang/p/8659950.html发现了,博主所说的他没有成功的方案一,我测试成功。
sudo是个用户组,只要把用户加到这个用户组,就可以使用sudo了,这才叫解决方案。
下面是具体步骤:
切换到不能使用sudo的用户,就叫hadoop2吧,登录以后,执行groups命令,发现是空的,也就是说用adduser增加的用户,不在任何用户组里。
而安装系统时创建的用户,hadoop1则有很多用户组:
adm cdrom sudo dip plugdev lpadmin sambashare
所以,用adduser把hadoop2加到sudo用户组:
adduser hadoop2 sudo
再次执行groups,sudo用户组就出现了。
再次执行sudo vim hadoop-env.sh,成功。
解决ubuntu系统“XXX is not in the sudoers file”错误的更多相关文章
- 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 ...
- ubuntu:xxx is not in the sudoers file. 问题解决
ubuntu 下普通用户用 sudo 执行命令时报 "xxx is not in the sudoers file.This incident will be reported" ...
- Linux有问必答:怎样解决“XXX is not in the sudoers file”错误
问题:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户名] is not in the sudoers file. This incid ...
- linux解决“XXX is not in the sudoers file”错误
问题:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户名] is not in the sudoers file. This incid ...
- 解决Ubuntu系统中文乱码显示问题,终端打开文件及查看目录
解决Ubuntu系统中文乱码显示问题 [日期:2014-02-20] 来源:Linux社区 作者:njchenyi [字体:大 中 小] 我是先安装了Ubuntu 12.04 Server,然后 ...
- 企业运维案例: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" 解决 ...
- centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法
修改主机名:vim /etc/sysconfig/network 1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 # ...
- Linux sudo 错误:XXX is not in the sudoers file 解决办法
最近在学习linux,在某个用户(xxx)下使用sudo的时候,提示以下错误:xxx is not in the sudoers file. This incident will be reporte ...
- 解决: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 ...
随机推荐
- 微信支付(APP支付)-服务端开发(一)
微信支付,首先需要注册一个商户平台公众账号,(网址:https://pay.weixin.qq.com/index.php/home/d_login) 目前微信支付的接入方式有四种方式:公众号支付,A ...
- Linux 系统实时监控的瑞士军刀 —— Glances
Linux 系统实时监控的瑞士军刀 —— Glances 对于 RHEL/CentOS/Fedora 发行版 ## RHEL/CentOS 7 64-Bit ## # wget http://dl.f ...
- Linux说明书 - man浅谈
原文链接: http://www.cnblogs.com/xuxn/archive/2011/08/26/linux-manual-man-command.html 所有学过Linux的同学都应该知道 ...
- Effective Java 第三版——51. 仔细设计方法签名
Tips 书中的源代码地址:https://github.com/jbloch/effective-java-3e-source-code 注意,书中的有些代码里方法是基于Java 9 API中的,所 ...
- 【Vegas原创】查询SQL Server更改记录的语句
指定数据库,然后: select Name,Create_date,Modify_Date from sys.objects where type in ('U','P', 'V','F', 'TR' ...
- Linux免密码登录设置 && 设置快捷键
看到这篇文章,你肯定是有这种需求. 假设要登录的机器为192.168.1.100,当前登录的机器为192.168.1.101. 首先在101的机器上生成密钥(如果已经生成可以跳过): $ ssh-ke ...
- 3. Tensorflow生成TFRecord
1. Tensorflow高效流水线Pipeline 2. Tensorflow的数据处理中的Dataset和Iterator 3. Tensorflow生成TFRecord 4. Tensorflo ...
- [转]JSTL 自定义方法报错Invalid syntax for function signature in TLD.
Apache Tomcat/6.0.18 ${my:splitApply(apply)} <function> <name>splitApply</name> &l ...
- 如何在wiced平台上编译,运行智能彩灯 实时控制彩灯的色调和开关
https://github.com/WildDogTeam/demo-c-rgblight/tree/master/src/device 恢复出厂的GPIO口在demo_platform.h声明为W ...
- Python内置类型——list
list(列表)是Python内置的可变序列(Sequence)类型,list的对象的方法也都是就地(in-place)更改调用这些方法的列表对象, List的一些细节 可以直接为list的某个下标赋 ...