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的更多相关文章

  1. 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命令时会报下面的 ...

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

  3. Linux sudo 错误:XXX is not in the sudoers file 解决办法

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

  4. sudo 提示 'xxx is not in the sudoers file.This incident will be reported.的解决方法'

    在使用 Linux 的过程中,有时候需要临时获取 root 权限来执行命令时,一般通过在命令前添加 sudo 来解决. 但是第一次使用 sudo 时,有可能会得到这样一个错误提示 xxx is not ...

  5. chmod: changing permissions of ‘/etc/fstab': Read-only file system

    给passwd文件加权限,修改/etc/fstab目录下所有的文件夹属性为可写可读可执行,执行以下命令:chomd 777 /etc/fstab 的时候提示错误: chmod: changing pe ...

  6. 当执行sudo时提示“is not in the sudoers file”的解决方案:

    出现这种提示是由于普通用户帐号没有权限执行sudo命令,所以需要切换到root身份进行颁发权限: $su -(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root ...

  7. 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 ...

  8. Linux使用sudo提权时,出现xx 不在 sudoers 文件中。此事将被报告。visudo 命令简单介绍。

    在使用 sudo 临时提权时,出现:不在 sudoers 文件中.此事将被报告. 可以使用 visudo命令 来配置/etc/sudoers文件,将目标用户赋予使用sudo命令的能力. visudo命 ...

  9. UBuntu sudo 命令 :xxx is not in the sudoers file. This incident will be reported.

    [1]分析问题 提示内容翻译成中文即:用户XXX(一般是新添加的用户名称)没有权限使用sudo. 解决方法修改新用户的权限,具体操作即修改一下/etc/sudoers文件. [2]切换至root用户模 ...

随机推荐

  1. qooxdoo 3.0 发布,JavaScript 的 GUI 框架

    qooxdoo 3.0 是一个主要的版本,包含很多新特性和内部的改动,qooxdoo 3.0 是一个通用的 JS 框架,主要改进体现在 qx.Desktop, qx.Mobile, 和 qx.Webs ...

  2. centos7 安装 notejs

    1.安装集成工具 yum -y install gcc make gcc-c++ 2.安装notejs 自行选择版本:https://nodejs.org/dist/ wget https://nod ...

  3. Free download

    http://blogs.msdn.com/b/mssmallbiz/archive/2014/07/07/largest-collection-of-free-microsoft-ebooks-ev ...

  4. [ACM_图论] Highways (变形说法的最小生成树)

    http://acm.hust.edu.cn/vjudge/contest/view.action?cid=28972#problem/C 题目给出T种情况,每种情况有n个城镇,接下来每一行是第i个城 ...

  5. [BTS] Error Can't update assemblies.

    Removal of the assembly failed. Make sure that all items in the assembly you are trying to remove fu ...

  6. 使用iMovie和Keynote制作App Preview

    App Preview是什么 App Preview就是一段15-30秒的短视频,用来展示你的应用的特性.用户界面.交互方式等内容.在App Store你的应用的详细信息页面里,放在原来的截图之前.体 ...

  7. DataGridViewComboBoxColumn值无效

    值无效,可能是你下拉框选项,没有这样的值,而你却设置这个值. dataGridView1.Rows[i].Cells[].Value = "选项一"; 解决方法就是在窗体的构造函数 ...

  8. 使用Nginx负载均衡搭建高性能.NETweb应用程序二

    在文章<使用Nginx负载均衡搭建高性能.NETweb应用程序一>中,让我们对Nginx有了一个初步认识,下面我们将在windows平台下面使用Nginx演示集群部署我们的web应用. 一 ...

  9. OpenBTS的安装(转)

    OpenBTS source code可以在这里下载:http://sourceforge.net/projects/openbts/ OpenBTS入门的各种问题可以在这里找到答案:http://g ...

  10. React中props.children和React.Children的区别

    在React中,当涉及组件嵌套,在父组件中使用props.children把所有子组件显示出来.如下: function ParentComponent(props){ return ( <di ...