[已解决]求救:/etc/sudoers错误,导致sduo命令无法使用

上网、浏览、聊天、下载等
回复
头像
大宝
帖子: 3049
注册时间: 2008-06-30 22:32
联系:

[已解决]求救:/etc/sudoers错误,导致sduo命令无法使用

#1

帖子 大宝 » 2008-09-02 10:22

偶试图按照网页上的教程,想实现Firestarter开机自动启动,为此修改了/etc/sudoers
修改内容为:lmh ALL= NOPASSWD: /usr/bin/firestarter
说明:“lmh"是我的用户名
错误症状:sudo: /etc/sudoers is mode 0644, should be 0440
好像是权限错误什么的,但不知如何修正,请各位高手高手高高手赐教。

解决方法见8楼
上次由 大宝 在 2008-09-02 12:02,总共编辑 1 次。
头像
大宝
帖子: 3049
注册时间: 2008-06-30 22:32
联系:

#2

帖子 大宝 » 2008-09-02 10:28

这是修改后的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

# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

lmh ALL= NOPASSWD: /usr/bin/firestarter
头像
solcomo
帖子: 2838
注册时间: 2007-04-25 13:12

#3

帖子 solcomo » 2008-09-02 10:31

su
chmod 440 /etc/sudoers
♜♞♝♛♚♝♞♜
♟♟♟♟♟♟♟♟
♙♙♙♙♙♙♙♙
♖♘♗♕♔♗♘♖

☠☯⚔⚓☣☦☃☕
☹☻☪☭☬⚖⚛⚜
ℜℳℬ™ ℋℯℓ℘ ℳℭ
sƂɐʍ рǀɹoʍ əɥʇ oS
头像
大宝
帖子: 3049
注册时间: 2008-06-30 22:32
联系:

#4

帖子 大宝 » 2008-09-02 10:36

solcomo 写了:su
chmod 440 /etc/sudoers
su鉴定错误
在装系统时就没为root设置口令
不知用LiveCD能否修复?如果能修复,请详细说明一下,谢谢。
头像
bones7456
帖子: 8495
注册时间: 2006-04-12 20:05
来自: 杭州
联系:

#5

帖子 bones7456 » 2008-09-02 10:38

grub菜单里选第二项,进去之后就有root权限
关注我的blog: ε==3
头像
大宝
帖子: 3049
注册时间: 2008-06-30 22:32
联系:

#6

帖子 大宝 » 2008-09-02 10:39

bones7456 写了:grub菜单里选第二项,进去之后就有root权限
好的,试一下
头像
HuntXu
帖子: 5776
注册时间: 2007-09-29 3:09

#7

帖子 HuntXu » 2008-09-02 10:41

这一定是用编辑器直接改权限编辑而没有用visudo的后果...
HUNT Unfortunately No Talent...
头像
大宝
帖子: 3049
注册时间: 2008-06-30 22:32
联系:

#8

帖子 大宝 » 2008-09-02 11:58

问题已经解决,解决方法如下:
1、重启电脑,选择第二项:recovery mode
2、选择root Dorp to root shell prompt
3、输入chmod 440 /etc/sudoers回车
4、按下Ctrl+Alt+Delete重启电脑,一切OK
在此特别感谢 solcomo 和 bones7456 的指导,谢谢!
头像
yuriwin
帖子: 104
注册时间: 2007-12-12 8:24

Re: [已解决]求救:/etc/sudoers错误,导致sduo命令无法使用

#9

帖子 yuriwin » 2013-01-18 11:25

我按照8楼的做法1、重启电脑,选择第二项:recovery mode
2、选择root Dorp to root shell prompt ,到第二步没有找到相应选项,无奈重启su,chmod 440 /etc/sudoers,接着sudo 出来提示:sudo: parse error in /etc/sudoers near line 22。我接着便打开/etc/souders,进行如下编辑:

省略**
root ALL=(ALL) ALL
libs ALL=(ALL) ALL
(从本行开始后面的全部删掉)

接着保存,没想到这样就可以了。 :em09
回复