is not in the sudoers file 问题解决【转载】
解决方案:
首需要切换到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 问题解决【转载】的更多相关文章
- Ubuntu下is not in the sudoers file 问题解决
在Ubuntu12.04 下,使用sudo apt-get install XXX 时,突然跳出 username is not in the sudoers file的问题 然后我一查此userna ...
- ubuntu:xxx is not in the sudoers file. 问题解决
ubuntu 下普通用户用 sudo 执行命令时报 "xxx is not in the sudoers file.This incident will be reported" ...
- 解决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 ...
- 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 ...
- oracle is not in the sudoers file. This incident will be reported.
准备把OS的root禁用了,所以其他用户要执行使用root执行的操作时,需要使用sudo. 在没有配置sudo的时候,执行sudo会出现类似以下的报错: [oracle@test ~]$ sudo / ...
- centos添加和删除用户及 xxx is not in the sudoers file.This incident will be reported.的解决方法
修改主机名:vim /etc/sysconfig/network 1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 # ...
- 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 ...
- 【linux】xx is not in the sudoers file 解决办法
原帖地址:http://blog.sina.com.cn/s/blog_4ef045ab0100j59t.html 我用的是redhat5.4,在一般用户下执行sudo命令提示llhtiger is ...
- CentOS下解决”用户账户is not in the sudoers file“问题
如上图,在当前用户cent(我的用户名)下使用sudo命令时,提示"cent is not in the sudoers file. This incident will be report ...
随机推荐
- maven3.04管理jetty9.2.10启动web项目
在pom.xml文件中添加如下: <build> <pluginManagement> <plugins> <plu ...
- lamp环境搭配(centos6.4)
(一)如果你的服务器没有链接网络可以先挂载本地光盘.设置yum源. 挂载光盘: [root@delphi ~]# mkdir /mnt/cdrom #新建挂载点 [root@delphi ~]# mo ...
- Windows 95 vs. Windows 10
- Swift语言—有趣的字符串连接、数组、字典
字符串链接:Swift语言中的字符串连接方式本人觉得非常的有趣,变量连接需要用右斜杠,并且变量名要括起来 “\(变量名)”,后面的字符串连接分别用逗号 ‘ , ’ 隔开 数组: Var arr = [ ...
- C# base64图片数据传送加号(+)变空格问题
今天遇到一个问题,将图片的base64数据转发,客户收到base64数据后生成图片失真. 通过日志监控,对比客户收到的数据和我发出的数据,最终发现客户base64数据中原本应该显示为加号(" ...
- 通俗理解隐马尔科夫模型HMM(转载)
作者:Yang Eninala 链接:https://www.zhihu.com/question/20962240/answer/33438846 来源:知乎 著作权归作者所有,转载请联系作者获得授 ...
- HDU 2277 Change the ball
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2277 Change the ball Time Limit: 2000/1000 MS (Java/O ...
- JQUERY知识总结
1, 让页面上某一个已存在的SELECT被选中的JQuery写法 $("#test").find("option[value='3']").prop(&quo ...
- html+css二级菜单制作!
二级菜单!!<!DOCTYPE html<html lang="e<head> <meta charset="UTF-8"> < ...
- 递归输出文件夹下的所有文件的名称(转自 MSDN)
问题:如何输出给定文件夹目录下面的所有文件的名称? C#代码: using System; using System.IO; namespace MyTest { public class Progr ...