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)的键盘。

时间: 2024-08-02 11:03:37

sudo 使用不了, the permissions on the /etc/sudoers file are changed to something other than 0440的相关文章

Linux中普通用户用sudo执行命令时报”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"错误,解决方法就是在/etc/sudoers文件里给该用户添加权限.如下: 1.切换到root用户下 方法为直接在命令行输入:su,然后输入密码(即你的登录密码,且密码默认不可见). 2./etc/sudoers文件默认是只读的,对root来说也是,因此需先添加sudoers文件的写权限,命令是: 即执行操作:chmod

使用sudo时user is not in sudoers file 的解决

在Linux操作系统中,以普通用户使用sudo时,常常会出现这个报错,如:[Oracle@DBA2 fd]$ sudo ps -ef|grep dbw[sudo] password for oracle: oracle is not in the sudoers file.  This incident will be reported.[[email protected] fd]$ 报错给出原因是用户oracle不在sudo的配置文件中,oracle用户无权限使用sudo: 解决办法:以roo

普通用户执行sudo报hadoop is not in the sudoers file

今天在用普通用户执行sudo命令时报错如下: hadoop is not in the sudoers file. This incident will be reported. 实测解决方式如下: 1,root用户登录. 2,进入到/etc目录. 3,执行chmod u+w /etc/sudoers给sudoers文件增加write权限. 4,执行vim sudoers 找到root ALL=(ALL) ALL这一行,一下面增加hadoopALL=(ALL) ALL(注:hadoop为普通用户

xxx is not in the sudoers file 和 Authority XXX 不能sudo解决方法

大致的场景是这样的: 系统中只有一个用户,不知进行了什么样的修改,导致这个用户获得不了root权限(先前是正常的)(据说是将这个用户加入了root组造成的,具体原因不明) 当这个用户想要用到root权限来进行相关操作的时候(执行sudo)系统显示: XXX is not in the sudoers file. This incident will be reported. 网上查找到相关的解决办法,是要修改/etc/sudoers文件,但是这个文件的修改是需要root权限的 想要获得root权

用sudo时提示"xxx is not in the sudoers file. This incident will be reported.

现象: 非Root用户在使用sudo命令时,提示:"xxx is not in the sudoers file. This incident will be reported.(xxx为用户名) 解决办法: 使用 su – root 切换到root用户,编辑sudoers文件 vim /etc/sudoers找到"root ALL=(ALL)"在此行下面添加一行 "xxx ALL=(ALL) ALL" //xxx 为用户名 保存即可.

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=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)ps:这里说下你可以sudoers添加下面四行中任意一条youuser            ALL=(ALL)                ALL%youuser           ALL=(ALL)  

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

[1]分析问题 提示内容翻译成中文即:用户XXX(一般是新添加的用户名称)没有权限使用sudo. 解决方法修改新用户的权限,具体操作即修改一下/etc/sudoers文件. [2]切换至root用户模式 命令:su - 备注:这里命令加有"-" ,与su是不同的. 在用命令"su"时只是切换到root,但没把root的环境变量传过去,还是当前用户的环境变量. 而用"su -"命令会将环境变量也一起切换过去(可以亲测,两个命令后分别查看环境变量$P

Ubuntu无法sudo提权,报当前用户不在sudoers文件中错误

Ubuntu安装后默认root不能登陆系统,密码也是随机生成,其他用户使用root权限,可以使用sudo提权,前提是该用户在/etc/sudoers配置列表中. 但是有时用户名从/etc/sudoers被意外删除了,sudo不能用了,root又不知道root密码(之前没有改过或者忘记了),如果想修改/etc/sudoers也不可能了,进入了一个死循环. 但可以如下面的方法解决: 1.重启按shift键,进入Ubuntu高级模式,选择一个recovery mode进入,出现一个9个选项的菜单,如果

Linux使用sudo提权时,出现xx 不在 sudoers 文件中。此事将被报告。

在使用 sudo 临时提权时,出现:不在 sudoers 文件中.此事将被报告. 可以使用visudo命令来配置/etc/sudoers文件,将目标用户赋予使用sudo命令的能力. 在 /etc/sudoers 文件中,有一处配置专门是配置哪些用户可以使用sudo命令的: 在这下边接着写: myusername ALL=(ALL:ALL) ALL 完后保存退出,此时myusername这个用户就可以使用sudo了.