当在终端执行sudo命令时,系统提示“luckchengis not in the sudoers file”:

$ sudo ls
Password:
luckcheng is not in the sudoers file. This incident will be reported.

其实就是没有权限进行sudo,解决方法如下(这里假设用户名是luckcheng):

1.切换到超级用户:$ su 
2.打开/etc/sudoers文件:$vi /etc/sudoers
.修改文件内容: 找到“root ALL=(ALL) ALL”一行,在下面插入新的一行,
内容是“luckcheng ALL=(ALL) ALL”,然后在vi键入命令“wq!”保存并退出。

注:这个文件是只读的,不加“!”保存会失败。

.退出超级用户:$ exit
.可以尽情使用sudo了。

[RedHat]“is not in the sudoers file”解决方法的更多相关文章

  1. Linux下is not in the sudoers file解决方法

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

  2. Linux中“is not in the sudoers file”解决方法

    当在终端执行sudo命令时,系统提示"hadoop is not in the sudoers file": 其实就是没有权限进行sudo,解决方法如下(这里假设用户名是cuser ...

  3. 关于Ubuntu下is not in the sudoers file解决方法

    当我在postgres用户下去执行sudo vim demo.sql需要用管理员权限运行时,并且输入本用户的密码,但是输入之后提示如下: postgers is not in the sudoers ...

  4. 用户不在sudoers文件中怎么办,ziheng is not in the sudoers file解决方法

    sudo是linux系统中,用来执行需要权限命令,但是一些朋友使用sudo时,出现下面的错误“ziheng is not in the sudoers file. This incident will ...

  5. [转]Linux下is not in the sudoers file解决方法

    来源: http://jingyan.baidu.com/article/2a1383284bb3e8074a134f2d.html 当我们使用sudo命令切换用户的时候可能会遇到提示以下错误:xxx ...

  6. is not in the sudoers file解决方法

    用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权 ...

  7. Ubuntu技巧之 is not in the sudoers file解决方法

    转自:http://www.linuxidc.com/Linux/2010-12/30386.htm 1)进入到root用户下. 2)添加文件的写权限.也就是输入命令"chmod u+w / ...

  8. vss error reading from file 解决方法

    vss error reading from file 解决方法 1 若服务器中存在 vss/data/backup目录,请将该目录删掉2 运行cmd cd.. cd C:\Program Files ...

  9. centos vsftpd 553 Could not create file解决方法

    centos vsftpd 553 Could not create file解决方法   问题由于selinux引起的,问题解决办法:   www.2cto.com   输入:getsebool - ...

随机推荐

  1. 推荐15款Google Chrome 插件

    Google Chrome是由Google开发的免费网页浏览器.Chrome是化学元素“铬”的英文名称,过去也用Chrome称呼浏览器的外框.Chrome相应的开放源代码计划名为Chromium,而G ...

  2. git在idea中使用

    (1)创建README.md文件 fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master)$ touch README.md ...

  3. matlab HW求法笔记

    for i=1:9400 Sbox_out_11(i) = length(findstr(num2str(dec2bin(Sbox_out_1(i,:))),'1')); end

  4. php安装xdebug扩展,PHPStorm+XDebug单步调试

    (一)php安装xdebug扩展,PHPStorm+XDebug单步调试 (二)PHPStorm配置XDebug (三)PHPStorm使用XDebug调试 (四)PhpStorm+Xdebug配置单 ...

  5. 使用xshell

    将选定的文本自动复制到剪贴板 并且 鼠标向右按钮定义为粘贴剪贴板内容

  6. java - GC垃圾收集器详解(三)

    以前收集器的特点 年轻代和老年代是各自独立且连续的内存块 年轻代收集必须使用单个eden+S0+S1进行复制算法 老年代收集扫描整个老年代区域 都是以尽可能少而快速地执行GC为设计原则 G1是什么 G ...

  7. smarty循环item命名规范

    使用smarty循环渲染数据时第二次循环item复制命名不规范 item=data 后面代码使用data会与后台返回数据冲突 {%foreach from=$data.bind_data key=ke ...

  8. Windows新建域时 administrator账户密码不符合要求解决办法~!

    解决方法  在cmd 命令行中 输入 net user administrator /passwordreq:yes

  9. 【巨杉数据库SequoiaDB】巨杉再获企业级认可,分布式数据库领跑“一亿中流”

    据全球最具权威的IT研究与顾问咨询公司 Gartner 预测,DBMS(数据库管理系统)市场从2017年到2018年增长了18.4%,达到461亿美元,这是有史以来最大幅的增长,并有望在2019年超过 ...

  10. Windows中配置maven环境变量

    添加maven环境变量 添加新的系统环境变量:MAVEN_HOME 设置其值为你安装的目录:D:\IT_program\apache-maven-3.6.0 更新系统PATH 变量 添加变量值:%MA ...