XXX is not in the sudoers file ……

网上资料都告诉大家,解决方法是改root ALL=(ALL) ALL那里,可能有的新手看不懂,这里解释一下。

在终端执行sudo命令时,Linux提示:“XXX is not in the sudoers file ……”

原因是没有权限进行sudo,解决方法如下:

  1. 切换到超级用户:#su (然后输入root的密码,即可登录)
  2. 打开/etc/sudoers文件:#visudo
  3. 修改文件内容(后面会说)
  4. 退出超级用户:#exit

有关修改文件,初学者可能不能接受这种纯命令行的方式。
做法是,找到"root ALL=(ALL) ALL"一行,在下面插入新的一行,内容是"username ALL=(ALL) ALL",然后在vim键入命令":wq!"保存并退出。
注:这个文件是只读的,不加“!”保存会失败。

How to write and save?

最难的是初学者不知道怎么才能修改这个文件并保存。
编辑的时候存在三种模式:

  • 一般模式:一进去就是这种状态,其实是只读的,不可写。
  • 编辑模式:在一般模式下按i就会进入编辑模式,此时就可以改写文件内容,按ESC可回到一般模式。
  • 命令模式:在一般模式下按:就会进入命令模式,左下角会有一个冒号出现,此时可以敲入命令并执行。(比如最后的保存啊,最初啊啥的)

【Linux】XXX is not in the sudoers file …… 的解决方案相关推荐

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

    原文地址:http://www.linuxidc.com/Linux/2010-12/30386.htm 用sudo时提示"xxx is not in the sudoers file. T ...

  2. 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. 解决 ...

  3. 【sudo错误】xxx is not in the sudoers file.This incident will be reported解决

    文章目录 1.问题 2.分析 3.解决方法 3.1 手动修改 3.2 命令方式修改--sudo visudo 4.扩展说明 1.问题 xxx is not in the sudoers file.Th ...

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

    Linux下is not in the sudoers file解决方法 当我们使用sudo命令切换用户的时候可能会遇到提示以下错误:用户名 is not in the sudoers file. 原 ...

  5. xxx is not in the sudoers file.This incident will be reported.的解决方法

    xxx is not in the sudoers file.This incident will be reported.的解决方法 参考文章: (1)xxx is not in the sudoe ...

  6. Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法

    Ubuntu下普通用户用sudo执行命令时报"xxx is not in the sudoers file.This incident will be reported"错误,解决 ...

  7. xxx is not in the sudoers file 解决方案(转)

    xxx is not in the sudoers file 解决方案(转) 首需要切换到root身份 $su - (注意有- ,这和su是不同的,在用命令"su"的时候只是切换到 ...

  8. xxx is not in the sudoers file. This incident will be reported.

    sudo,用其他用户的身份执行命令. 运行该命令时,系统首先检查/etc/sudoers,判断该用户是否有执行sudo的权限,在确定有执行权限后,要求输入自己的密码(当前用户),如果密码正确,会以ro ...

  9. xxx is not in the sudoers file.This incident will be reported错误

    普通用户用sudo执行命令时报"xxx is not in the sudoers file.This incident will be reported"错误,解决方法就是在/e ...

最新文章

  1. Spring事务管理只对出现运行期异常进行回滚
  2. 大轴纸怎么上机器人_岛国首发和尚机器人,地位直逼观世音
  3. SparkRPC源码分析之RPC管道与消息类型
  4. 五分钟学会悲观乐观锁-java vs mysql vs redis三种实现
  5. Python 中浅拷贝的四种实现方法
  6. python中 5个带key内置函数
  7. 补8-5日复习内容 STL 标准模板库的容器
  8. Exchange队列优先级介绍和配置
  9. java里函数式表达式_java8入门(lambda表达式、函数式接口相关)
  10. dpf linux安装db2_值得一看!数据库及Mysql入门,附详细安装教程
  11. 使用ocupload和POI一键上传Excel并解析导入数据库
  12. 【TWVRP】基于matlab遗传算法求解多车场带时间窗的车辆路径规划问题【含Matlab源码 1035期】
  13. 记录Java学习书籍
  14. 利用实体类接收中国电信物联网平台推送的数据
  15. HTML+CSS项目实践五:使用纯CSS实现点击文字切换图片效果(不使用JS)
  16. Qt手动设置Kits套件
  17. Efficient polynomial commitment schemes for multiple points and polynomials学习笔记
  18. 学生学籍管理系统(c语言)
  19. 2019 / 3 /24 触摸屏键盘的功能实现
  20. 求解二分图的独立集问题

热门文章

  1. ELK篇---------elasticsearch集群安装配置
  2. [转载] KAFKA分布式消息系统
  3. ASP.NET MVC 4 小项目开发总结
  4. Oracle 索引概述
  5. 解决StreamReader读取中文出现乱码的问题
  6. 微软总裁比尔.盖茨给即将走出学校、踏入社会的青年一代下列11点忠告
  7. Front End Accessibility Development Guide
  8. c++利用windows api遍历指定文件夹及其子文件夹中的文件
  9. ipad如何连接电脑_电脑无法连接外网远程调试,一文教你如何用手机让台式机连接外网...
  10. c 语言 16进制写法,C语言16进制中16怎么表示?