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. HTML框架,列表,表格
  2. 【JUC并发编程06】多线程锁 (公平锁和非公平锁,死锁,可重锁)
  3. [游戏开发-学习笔记]菜鸟慢慢飞(12)- Unity3D中LitJson 解析遇到的问题
  4. 串口收数数码管显示(串口带协议带校验)
  5. 浏览器事件 - 监听浏览器刷新问题及解决方案
  6. springboot返回时间问题
  7. 一不小心画了 24 张图剖析计网应用层协议!
  8. 大厂程序员的一天是如何度过的?
  9. 【Scala笔记——道】Scala 循环遍历 for详解
  10. unity urp 棉麻织物渲染
  11. php 计算工龄,excel如何计算工龄
  12. 一个网站完整详细的SEO优化方案
  13. Python 基础(二)[列表,字典,文件操作]
  14. 华为v5服务器raid设置系统,华为服务器2288hv5raid阵列卡制作
  15. 电脑插上U盘,无线鼠标无法使用问题解决
  16. DEBUG命令大全及实例(有改动)
  17. python植物大战僵尸辅助器手机版_GitHub又放大招,Python版本的植物大战僵尸还能作弊玩!...
  18. 苹果Mac Mini SD读卡器支持2TB内存卡
  19. 投资效率模型两个版本(含stata代码以及计算参考文献)
  20. DA, DH, MDA, MDH,MSA到底是什么

热门文章

  1. js获取一个月的天数
  2. linux自动挂载windows磁盘
  3. Python成长之路_装饰器
  4. httpServlet,java web后台服务
  5. 【原】unity3D ios 退出保存数据(2)
  6. activemq控制发送频率_发送activemq
  7. python mysql实例_Python 操作MySQL详解及实例
  8. 怎样判断电饭锅温度传感器的好坏?_空调温度传感器的作用与检测。
  9. 并发编程概念、程序线程进程、线程同步、互斥量、读写锁、协程并发
  10. cod16 服务器正在维护,使命召唤16玩不了怎么办 使命召唤16进不去解决方法