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 to fix it:
本次操作目的:
修复切换sudo 时报错: /etc/sudoers, 应该是0440 权限。
重启服务器后,
• 方法一:通过recover mode ,进入root shell
进入GNU GRUB 界面:
选择Advanced options for Ubuntu
选择recovery mode (如果没有 recovery mode,则看 通过GRUB 编辑模式,进入root shell)
选择 root : drop root shell prompt
然后进入提示 root:~#
运行: cd /var/log
运行: touch a
是否提示 read only file system
是则 运行: mount -o rw,remount /
运行: ls -l /etc/sudoers 。
请反馈权限是否: -r---r-------
运行:chmod 0440 /etc/sudoers
运行:reboot或则alt+ctrl+del
重启系统即可。
• 方法二:通过GRUB 编辑模式,进入root shell
首先,进入系统,会显示这个界面
如果没有显示这个界面,请在机器启动后,系统启动时,不停按esc键,调出此grub菜单
光标选中第一个选项,即第一个系统,按e键进入编辑模式。
按下e键,出现下图:
光标下移,找到这个选项 linux /boot/vmlinuz-3``````` ro quiet spash $vt_handoff
如下图:
内容大同小异,主要找到含有“linux /boot/vmlinuz-”这一行代码,在代码后面空一格,加入如下代码:
rw init=/bin/bash
添加完如下图所示:
添加完后,按住ctrl+x或者f10进入系统(见屏幕下方提示),此时将进入如下界面:
成功后如下图所示:运行:chmod 0440 /etc/sudoers
此时,运行:reboot或则alt+ctrl+del
重启系统即可。
错误情况:进入上图命令行界面后,可能出现键盘无法输入的问题,如出现此种情况,请换圆口接口(ps/2)的键盘。
sudo 使用不了, the permissions on the /etc/sudoers file are changed to something other than 0440的更多相关文章
- Linux中新建用户用不了sudo命令问题:rootr is not in the sudoers file.This incident will be reported解决
参考:https://blog.csdn.net/lichangzai/article/details/39501025 如果执行sudo命令的用户没有执行sudo的权限,执行sudo命令时会报下面的 ...
- 解决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 ...
- Linux sudo 错误:XXX is not in the sudoers file 解决办法
最近在学习linux,在某个用户(xxx)下使用sudo的时候,提示以下错误:xxx is not in the sudoers file. This incident will be reporte ...
- sudo 提示 'xxx is not in the sudoers file.This incident will be reported.的解决方法'
在使用 Linux 的过程中,有时候需要临时获取 root 权限来执行命令时,一般通过在命令前添加 sudo 来解决. 但是第一次使用 sudo 时,有可能会得到这样一个错误提示 xxx is not ...
- chmod: changing permissions of ‘/etc/fstab': Read-only file system
给passwd文件加权限,修改/etc/fstab目录下所有的文件夹属性为可写可读可执行,执行以下命令:chomd 777 /etc/fstab 的时候提示错误: chmod: changing pe ...
- 当执行sudo时提示“is not in the sudoers file”的解决方案:
出现这种提示是由于普通用户帐号没有权限执行sudo命令,所以需要切换到root身份进行颁发权限: $su -(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root ...
- xxx is not in the sudoers file.This incident will be reported.的解决方法 (一般用户不能执行sudo)
1.切换到root用户下 2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers 3.编辑sudoers文件vi /etc/sudoers找到这行 root ALL=(AL ...
- Linux使用sudo提权时,出现xx 不在 sudoers 文件中。此事将被报告。visudo 命令简单介绍。
在使用 sudo 临时提权时,出现:不在 sudoers 文件中.此事将被报告. 可以使用 visudo命令 来配置/etc/sudoers文件,将目标用户赋予使用sudo命令的能力. visudo命 ...
- UBuntu sudo 命令 :xxx is not in the sudoers file. This incident will be reported.
[1]分析问题 提示内容翻译成中文即:用户XXX(一般是新添加的用户名称)没有权限使用sudo. 解决方法修改新用户的权限,具体操作即修改一下/etc/sudoers文件. [2]切换至root用户模 ...
随机推荐
- 不制作证书是否能加密SQLSERVER与客户端之间传输的数据?
不制作证书是否能加密SQLSERVER与客户端之间传输的数据? 在做实验之前请先下载network monitor抓包工具 微软官网下载:http://www.microsoft.com/en-us/ ...
- [游戏模版3] Win32 画笔 画刷 图形
>_<:introduce the functions of define\create\use pen and brush to draw all kinds of line and s ...
- 我的cookie读写
前后台必须一致, 后台: public static void SetCookie(string cookieName, string value, int expiresDays){ var ...
- proj01总结:spring jdbc操作
commons-collections.jar: Apache Commons包中的一个,包含了一些Apache开发的集合类,功能比java.util.*强大.必须使用的jar包. commons-l ...
- c#访问http接口的"编码"问题
记一次访问http数据接口的爬坑经历,一般访问一个http接口. 无非就是这么几行代码: HttpWebRequest request = (HttpWebRequest)WebRequest.Cre ...
- mobilebone.js使用笔记
mobilebone.js主要用来是网页呈现单页效果,添加类似native app的页面切换效果.原理是:当打开a链接里的页面时,不再以传统的新页面打开,而是以ajax-html的方式,将新页面的内容 ...
- Atitit.js图表控件总结
Atitit.js图表控件总结 1. 为什么要使用图表1 2. 图表分类1 3. 数据可视化的优点1 4. 流行的js图表类库1 5. 参考2 1. 为什么要使用图表 因为要可视化 2. 图表分类 条 ...
- atitit. 日志系统的原则and设计and最佳实践(1)-----原理理论总结.
atitit. 日志系统的原则and设计and最佳实践总结. 1. 日志系统是一种不可或缺的单元测试,跟踪调试工具 1 2. 日志系统框架通常应当包括如下基本特性 1 1. 所输出的日志拥有自己的分类 ...
- atitit.提升2--3倍开发效率--cbb体系的建设..
atitit.提升开发效率--cbb体系的建设.. #--提升倍数,大概2--3倍.. #---cbb的内容 知识的,expt的,经验的技术的部件的问题库的角度.. #---cbb的层次,tech l ...
- php计算时间差
echo "今天:".date("Y-m-d")."<br>"; echo "昨天:".date(" ...