用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”错误的更多相关文章

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

  2. ubuntu:xxx is not in the sudoers file. 问题解决

    ubuntu 下普通用户用 sudo 执行命令时报 "xxx is not in the sudoers file.This incident will be reported" ...

  3. Linux有问必答:怎样解决“XXX is not in the sudoers file”错误

    问题:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户名] is not in the sudoers file. This incid ...

  4. linux解决“XXX is not in the sudoers file”错误

    问题:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户名] is not in the sudoers file. This incid ...

  5. 解决Ubuntu系统中文乱码显示问题,终端打开文件及查看目录

    解决Ubuntu系统中文乱码显示问题 [日期:2014-02-20] 来源:Linux社区  作者:njchenyi [字体:大 中 小]   我是先安装了Ubuntu 12.04 Server,然后 ...

  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. centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法

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

  8. Linux sudo 错误:XXX is not in the sudoers file 解决办法

    最近在学习linux,在某个用户(xxx)下使用sudo的时候,提示以下错误:xxx is not in the sudoers file. This incident will be reporte ...

  9. 解决: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 ...

随机推荐

  1. Vue加载组件、动态加载组件的几种方式

    https://cn.vuejs.org/v2/guide/components.html https://cn.vuejs.org/v2/guide/components-dynamic-async ...

  2. 【Windows】Windows中解析DOS的DIR命令使用

    总结一下cmd中的dir命令的用法 64位win10系统上,打印帮助文档. D:\test>dir /? 显示目录中的文件和子目录列表. DIR [drive:][path][filename] ...

  3. System Monitor for Mac(系统监控工具)破解版安装

    1.软件简介    System Monitor 是 macOS 系统上的一款非常实用的 Mac 系统工具,System Monitor for mac 是一款六合一应用,您可以同时获得 CPU.RA ...

  4. Myloader参数说明

    -d, --directory 备份文件的目录 -q, --queries-per-transaction 每次事务执行的查询数量,默认是1000 -o, --overwrite-tables 如果要 ...

  5. linux内核剖析(零)linux系统启动过程详解-开机加电后发生了什么

    本文参考了如下文章 深入理解linux启动过程 mbr (主引导记录(Master Boot Record)) 电脑从开机加电到操作系统main函数之前执行的过程 详解linux系统的启动过程及系统初 ...

  6. Zabbix-2.X/3.X监控工具监控Redis以及zabbix Redis监控模板下载

    为了监控Redis3的运行状况,去zabbix官网查找资料,根据提示,找到了这个项目:https://github.com/blacked/zbx_redis_template 但是文档和内容已经不匹 ...

  7. [svc]数字证书基础知识

    数字证书基础原理 数字证书采用PKI(Public Key Infrastructure)公开密钥基础架构技术,利用一对互相匹配的密钥进行加密和解密. 每个用户自己设定一把特定的仅为本人所知的私有密钥 ...

  8. Understanding How Graal Works - a Java JIT Compiler Written in Java

    https://chrisseaton.com/truffleruby/jokerconf17/ https://chrisseaton.com/truffleruby/tenthings/ http ...

  9. Android查询不到电话号码解决方法

    貌似联系人有三个数据库,且不同步,另外也有可能是版本问题. 解决方案:https://github.com/codinguser/android_contact_picker 接下来会对其进行一些改造 ...

  10. Android Wifi 主动扫描 被动扫描

    介绍主动扫描,被动扫描以及连接的wifi的扫描过程 参考文档 <802.11无线网络权威指南> <80_Y0513_1_QCA_WCN36X0_SOFTWARE_ARCHITECTU ...