sudoers文件更改错误,root权限无法使用的解决方案
2012-10-23 10:11
916 查看
/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
参考:http://psychocats.net/ubuntu/fixsudo
http://my5622576.iteye.com/blog/662158
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
参考:http://psychocats.net/ubuntu/fixsudo
http://my5622576.iteye.com/blog/662158
相关文章推荐
- 网狐荣耀版vs生成解决方案时出现“出现未能写入日志,请求的操作无法在使用用户映射区域打开的文件上执行“错误
- bashrc文件中环境变量配置错误,导致linux命令无法正常使用的解决方案
- bashrc文件中环境变量配置错误,导致linux无法正常使用的解决方案
- ComDom在使用函数CompileAssemblyFromFile时无法找到文件的错误
- SQLServer 导入mdf和ldf文件出现:无法打开物理文件 "D:\XX.mdf"。操作系统错误 5:"5(拒绝访问。)"的解决方案
- ajaxfileupload.js在ie9中无法正常使用,有语法错误解决方案
- 使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题分析
- 关于在单独的 Js文件中无法使用 <%= %> 的原因及解决方案
- VS调试出现错误提示 无法将“obj\Debug\*.*”复制到“bin\Debug\*.*”,文件正在由另一个进程使用,因此该进程无法访问此文件
- 请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理解决方案 服务器配置错误
- 【Visual C++】关于无法打开包括文件:“StdAfx.h”或者意外结尾的错误解决方案
- "无法使用前导 .. 在顶级目录上退出" 错误分析以及解决方案
- Xcode8 使用CoreData生成对象文件出现编译错误解决方案
- DB2远程客户端无法使用import导入本地数据文件解决方案
- vs生成解决方案错误无法将文件“xx.*”复制到xx.*”。对路径“bin\xx.*”的访问被拒绝
- 错误 1 无法将文件“obj\Debug\XXX.exe”复制到“bin\Debug\XXX.exe”。文件“bin\Debug\XXX.exe”正由另一进程使用,因此该进程无法访问该文件
- [原]【Visual C++】关于无法打开包括文件:“StdAfx.h”或者意外结尾的错误解决方案
- IIS “另一个程序正在使用此文件,进程无法访问。”错误提示的解决办法
- VS2012 编译程序时报无法加载PDB文件错误解决方案(转自http://www.aiuxian.com/article/p-236400.html)