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用户模 ...
随机推荐
- PHP文件相关
<?php class FileDemo { function Test() { print __FILE__."<br/>"; //返回文件完整路径,如 E:/ ...
- Dynamic CRM 2013学习笔记(二十九)报表设计:reporting service 报表开发常见问题
在报表开发过程中,经常会遇到各种各样的问题,比如The report cannot be displayed. (rsProcessingAborted),一点有意义的提示都没有:再就是分页问题,经常 ...
- TypeScript:类(Classes)
返回TypeScript手册总目录 传统的Javascript关注的是函数(function)和基于原型(prototype-based)的继承作为构建可重复使用组件的基本方式,但是与更舒服地使用面向 ...
- javascript中的splice方法介绍&示例
javascript 中的 splice 方法很强大,它可以用于插入.删除或替换数组的元素. 下面来一一介绍! 删除:用于删除元素,两个参数,第一个参数(要删除第一项的位置),第二个参数(要删除的项数 ...
- Server Develop (六) Linux epoll总结
Linux epoll epoll是Kernel 2.6后新加入的事件机制,在高并发条件下,远优于select.epoll最大的好处在于它不会随着监听fd数目的增长而降低效率.因为在内核中的sele ...
- JsRender实用教程(tag else使用、循环嵌套访问父级数据)
前言 JsRender是一款基于jQuery的JavaScript模版引擎,它具有如下特点: · 简单直观 · 功能强大 · 可扩展的 · 快如闪电 这些特性看起来很厉害,但几乎每个模版引擎, ...
- Django配置与静态文件
settings.py """ Django settings for myproject project. Generated by 'django-admin sta ...
- Tomcat之web项目部署
Tomcat一般用于部署JavaWeb项目. 遇到的问题 Linux操作系统中,在tomcat中部署项目时,一般只需要把项目war包:demo.war放到webapps下,然后启动tomcat即可.这 ...
- VC基于消息的异步套接字
用WSAStartup,需要在StdAfx.h头文件中需要声明 #include #pragma comment(lib,"WS2_32.lib") 用AfxSocket ...
- python读文件
第一种方法 #encoding=utf-8 file = open("./man_data.txt","r") try: print file.read() f ...