解决方案:
首需要切换到root身份
$su -

或者

$sudo -s

(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su -"命令将环境变量也一起带过去,就象和root登录一样)

然后
$visudo     //切记,此处没有vi和sudo之间没有空格

1、移动光标,到最后一行
2、按a,进入append模式
3、输入
your_user_name ALL=(ALL)  ALL
4、按Esc
5、输入“:w”(保存文件)
6、输入“:q”(退出)

这样就把自己加入了sudo组,可以使用sudo命令了。

redhat5.4,在一般用户下执行sudo命令提示llhtiger is not in the sudoers file. This incident will be reported.解决方法:

一、$whereis sudoers -------找出文件所在的位置,默认都是/etc/sudoers         
二、 #chmod u+w /etc/sudoers    以超级用户登录su -root ,修改文件权限即添加文件拥有这的写权限 限,ls -al /etc/sudoers 可以查看原文件的权限。    
三、vim /etc/sudoers 编辑文件,在root ALL=(ALL)ALL行下添加XXX ALL=(ALL)ALL,XXX为你的用户名。添加方法:找到root行,按下”i“键进入编辑模式添加即可!编辑好后esc键进入一般模式,“:wq"保存退出!
最后, #chmod u-w /etc/sudoers 回到文件的原权限!

is not in the sudoers file 问题解决【转载】的更多相关文章

  1. Ubuntu下is not in the sudoers file 问题解决

    在Ubuntu12.04 下,使用sudo apt-get install XXX 时,突然跳出 username is not in the sudoers file的问题 然后我一查此userna ...

  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下sudo更改文件权限报错xxxis not in the sudoers file. This incident will be reported.

    本文转自Linux社区作者为z-sm的文章 原文链接http://www.linuxidc.com/Linux/2016-07/133066.htm 之前一直使用的是ubuntu,后来安装了Cento ...

  4. sunzl is not in the sudoers file.This incident will be reported

    Description: [sunzl@localhost nuc900bsp$] ./install.sh sorry!you are not the root !! [sunzl@localhos ...

  5. oracle is not in the sudoers file. This incident will be reported.

    准备把OS的root禁用了,所以其他用户要执行使用root执行的操作时,需要使用sudo. 在没有配置sudo的时候,执行sudo会出现类似以下的报错: [oracle@test ~]$ sudo / ...

  6. centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法

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

  7. sudo 使用不了, the permissions on the /etc/sudoers file are changed to something other than 0440

    sudo 使用不了,报错: the permissions on the /etc/sudoers file are changed to something other than 0440 how ...

  8. 【linux】xx is not in the sudoers file 解决办法

    原帖地址:http://blog.sina.com.cn/s/blog_4ef045ab0100j59t.html 我用的是redhat5.4,在一般用户下执行sudo命令提示llhtiger is ...

  9. CentOS下解决”用户账户is not in the sudoers file“问题

    如上图,在当前用户cent(我的用户名)下使用sudo命令时,提示"cent is not in the sudoers file. This incident will be report ...

随机推荐

  1. CSU 1325 莫比乌斯反演

    题目大意: 一.有多少个有序数对(x,y)满足1<=x<=A,1<=y<=B,并且gcd(x,y)为p的一个约数: 二.有多少个有序数对(x,y)满足1<=x<=A ...

  2. Topcoder SRM 583 DIV2 SwappingDigits

    题目题意是交换一次,使数字最小,且数字前面不能有前导0 string minNumber(string num) { string res = num; for(int i = 0 ; i < ...

  3. CodeForces 686A-Free Ice Cream

    题目: 儿童排队领冰激凌,给你两个数n,x分别代表接下来有n行与初始的冰激淋数:接下来n行,每行有一个字符('+'or‘-’),还有一个整数d,+d表示新增的冰激 凌数(由搬运工搬运到此),-d表示儿 ...

  4. sql数据库 管理处理问题--维护计划

    问题:SQLServer 错误: 15404,无法获取有关 Windows NT 组/用户 MYPC/Administrator' 的信息,错误代码 0x534. [SQLSTATE 42000] ( ...

  5. 初学者SQL语句介绍

    初学者SQL语句介绍      1.用 Select 子句检索记录    Select 子句是每一个检索数据的查询核心.它告诉数据库引擎返回什么字段.    Select 子句的常见形式是:    S ...

  6. C语言样式的文件操作函数

    使用C语言样式的文件操作函数,需要包含stdio.h头文件. 1.打开文件的函数: //oflag的取值为“w”或“r”,分别表示以写或读的方式打开 FILE* fd = fopen(filename ...

  7. sqoop连接oracle与mysql&mariadb的错误

    错误说明: 由于我的hadoop的集群是用cloudera manager在线自动安装的,因此他们的安装路径必须遵循cloudera的规则,这里只有查看cloudera的官方文档了,请参考:http: ...

  8. 使用OpenXML操作Office文档

    使用OpenXML类库, 以编程的方式来访问PowerPoint, Word, Excel等文档, 有时能够为我们批量编辑文档提供方便. 最近项目中遇到的两个任务是: 1. 替换文档中的图片的Alt ...

  9. Opencv基本数据结构

    Opencv的数据结构:CvPoint系列.CvSize系列 .CvSize.CvRect.CvScalar.CvAr 大多数据结构都在cxtypes.h这个头文件里定义 1.CvPoint系列:   ...

  10. Opencv结构与内容

    一.Opencv的结构分类: cxcore.cv.ML(Machine Learning).HighGUI.cvcam.cvaux 二.常见结构的内容与算法: 1.cxcore库(基本结构和算法.XM ...