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用户模 ...
随机推荐
- What's New in C# 6.0
Static Types as using So, we are all quite familiar with this notion of accessing static class membe ...
- 在CS代码页获取input输入框内肉----.net学习点滴
想在后台cs页面得到前台页面aspx中html控件input输入的值.通过访问input输入框的name属性值获取. 解决方法如下: 1.用Request["user"].toSt ...
- Android View 如何绘制
上文说道了Android如何测量,但是一个漂亮的控件我只知道您长到哪儿,这当然不行.只需要简单重写OnDraw方法,并在Canvas(画布)对象上调用那根五颜六色的画笔就能够画出这控件"性感 ...
- SQLServer DBA 三十问(加强版)
距离最初发布SQLServer DBA 三十问 已有一年多了,大家对其中的某些问题讨论比较激烈,要回答出来这些问题需要比较扎实的SQLServer 基础和一定的实际操作经验,如果你试着去回答其中的问题 ...
- [JS3] 立即执行JS
<html> <head> <title>立即执行</title> <SCRIPT TYPE="text/JavaScript" ...
- 从数组中选出和等于固定值的n个数(JavaScript实现)
现实生活中的问题,可能会抽象为这样一种数据模型: 从一个数组中挑选出几个数,让这几个数相加的和为指定的值. 大多数读者应该有过网购的经历,网购一般会有个凑单功能,假如读者买了70元的商品,但是必须满1 ...
- maven nexus 3 third party 构件上传
mvn -e deploy:deploy-file -DgroupId=com.oracle -DartifactId=JDBCDriver -Dversion=12.0.1 -Dpackaging= ...
- Linux-vmware tools安装与cdrom挂载
前述 昨天想直接复制虚拟机centos系统中命令行的内容到主机的txt文档上进行保存,发现不能实现虚拟机与主机之间的直接通讯,后来查资料发现原来是由于我的虚拟机没有安装vwmare tools的缘故. ...
- Revit API 获取某墙上洞口的尺寸和位置
[Transaction(TransactionMode.Manual)] [Regeneration(RegenerationOption.Manual)] public class cmd2012 ...
- android: SharedPreferences实现记住密码功能
既然是实现记住密码的功能,那么我们就不需要从头去写了,因为在上一章中的最佳实 践部分已经编写过一个登录界面了,有可以重用的代码为什么不用呢?那就首先打开 BroadcastBestPractice 项 ...