`

sudoers文件更改错误,root权限无法使用的解决方案

 
阅读更多


转自:
http://blog.csdn.net/jibcy/article/details/8101602


/etc/sudoers: syntax error near line
sudo: parse error in /etc/sudoers near line 25
sudo: no valid sudoers sources found, quitting
终极解决方案:

1. 开机,不停的按shift键,进入recovery模式
2. 选中root账号
3. chmod 666 /dev/null
   mount -o remount rw /
4. nano /etc/sudoers
恢复本文件内容并存盘。

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Allow members of group sudo to execute any command after they have
# provided their password
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
分享到:
评论

相关推荐

    ubuntu系统中有关sudoers文件访问错误的解决方法

    此文档详细介绍在ubuntu系统下由于某种操作(修改了/usr/目录下某些文件的权限,修改了用户的名字等)导致sudoers文件不可用时的解决方法。非常有用。

    sudoers文件编辑和使用

    sudoers文件编辑和使用

    030101配置用户使用sudo无需密码

    三、/etc/sudoers文件解释 [root@test ~]# cat /etc/sudoers ## Sudoers allows particular users to run various commands as ## the root user, without needing the root password. ##该文件允许特定用户像root...

    树莓派sudoers文件

    树莓派使用的sudoers文件,当调用管理员权限出问题时,很有可能是该文件出现了问题,一个可行的方法就是使用另一个Linux系统替换该文件。

    xxx is not in the sudoers file解决方法

    用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。

    ansible-sudoers:控制默认etcsudoers文件和包含的文件目录的配置

    ansible-sudoers:控制默认etcsudoers文件和包含的文件目录的配置

    解决 用户不在 sudoers 文件中 的问题

    使用sudo提权时出现:xx用户不在 sudoers 文件中。

    linux不能使用sudo命令解决方案

    linux不能使用sudo命令解决方案,username is not in the sudoers file

    linux给用户添加root权限方法总结

    1、添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户 ...Changing password for user ...方法一: 修改 /etc/sudoers 文件,找到下面一行,把前面的注释(#)去掉

    Ansible-ansible-sudoers.zip

    Ansible-ansible-sudoers.zip,控制默认/etc/sudoers文件和包含的文件/目录的配置。,ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。

    Linux给普通用户加超级用户权限的方法

    问题假设用户名为:ali如果用户名没有超级用户权限,当输入 sudo + 命令 时, 系统提示: 代码如下:ali is not in the sudoers file. This incident will be reported.解决1. 进入超级用户模式。即输入”su”,系统...

    Linux系统如何添加普通用户到 sudoers 文件

    主要介绍了Linux系统添加普通用户到 sudoers 文件的方法,在文章给大家补充Debian将普通用户添加到sudoer文件的方法,感兴趣的朋友一起看看吧

    linux中如何添加用户并赋予root权限详解

    一、linux添加用户并赋予root权限 1、添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser eric //添加一个名为eric的用户 ...Changing password for user ...方法一:修改 /etc/sudoers 文件,找到下面

    CentOS 7 中完成普通用户向root用户借权的设置.zip

    在CentOS 7系统中,可以通过配置sudoers文件来允许普通用户向root用户借权。这个设置可以让普通用户在一定范围内执行特权操作,提高系统的安全性和管理灵活性。

    ansible-sudoers:在类似Debian的系统中管理sudoers和sudoers.d的角色

    sudoers_sudoers : /etc/sudoers文件声明 sudoers_sudoers.defaults :[默认:请参见defaults/main.yml ]:默认配置选项 sudoers_sudoers.host_aliases :[默认值: [] ]: Host_Alias类型的别名列表 sudoers_...

    grant:保护sudoers文件

    该项目旨在简化安全sudoers文件的创建,主要目标是: 通过与现有最佳实践保持一致,减少歧义和错误配置。 自动创建校验和,二进制选项等。 设置安全默认值。 发现非安全设置时发出警告 用法 建造 确保拥有最新的...

    Mac sudoers.dmg

    最新Mac OS --sudo 工具,安装以后,Mac 可以执行sudo命令

    Linux用户配置sudo权限(visudo)的方法

    sudo的工作过程如下: 1,当用户执行sudo时,系统会主动寻找/etc/sudoers文件,...visudo使用vi打开/etc/sudoers文件,但是在保存退出时,visudo会检查内部语法,避免用户输入错误信息 visudo需要root权限 [hadoop@l

    O-Linux&Shell-W5

    step2 使用root用户对比使用四种文档查看命令查看/etc/sudoers文件,并且查询到root权限白名单的设置位置。请问用more、less、head和tail中的哪一个命令能够实现查询特定字符串的作用,请理解和说明more、less、head...

    redhat以root身份运行命令.docx

    redhat 7.2版本以root身份运行程序,精细化管理,和/etc/sudoers文档详解

Global site tag (gtag.js) - Google Analytics