sudo 不能正常使用,麻烦看下

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
头像
mengkeq
帖子: 49
注册时间: 2008-03-29 17:33

sudo 不能正常使用,麻烦看下

#1

帖子 mengkeq » 2009-03-22 12:50

8.10系统更新后,sudo不能正常使用,每次输入sudo命令后,提示

代码: 全选

sudo: /etc/sudoers is owned by gid 1002, should be 0
,后google后使用过

代码: 全选

chown root:root /etc/sudoers
chmod 0440 /etc/sudoers
,重启后问题依旧,贴下/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

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
希望高手能帮忙解决下这个问题,谢谢了。
补充下,su可以正常使用。
上次由 mengkeq 在 2009-03-22 17:23,总共编辑 2 次。
笨鸟也要飞........
头像
command
帖子: 306
注册时间: 2007-10-14 0:50
来自: GUCAS

Re: sudo 不能正常使用,麻烦高手看下

#2

帖子 command » 2009-03-22 15:56

在root ALL=(ALL) ALL下面加一行
youraccount ALL=(ALL) ALL
试试
OS: Debian GNU/Linux
Version: lenny
Kernel: 2.6.36
Xorg: 1.4.2
CPU: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
HD: 320G SATA
Memory: 2G DDRIII
Graphics:Mobility Radeon HD 3450
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

Re: sudo 不能正常使用,麻烦高手看下

#3

帖子 BigSnake.NET » 2009-03-22 16:51

重启后问题依旧
贴出错输出
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
mengkeq
帖子: 49
注册时间: 2008-03-29 17:33

Re: sudo 不能正常使用,麻烦高手看下

#4

帖子 mengkeq » 2009-03-22 17:20

command 写了:在root ALL=(ALL) ALL下面加一行
youraccount ALL=(ALL) ALL
试试
/etc/sudoers这个文件是只读文件,改了不能保存.
笨鸟也要飞........
头像
mengkeq
帖子: 49
注册时间: 2008-03-29 17:33

Re: sudo 不能正常使用,麻烦高手看下

#5

帖子 mengkeq » 2009-03-22 17:21

BigSnake.NET 写了:
重启后问题依旧
贴出错输出
就是

代码: 全选

sudo: /etc/sudoers is owned by gid 1002, should be 0
这个问题.没别的提示了.
笨鸟也要飞........
头像
mengkeq
帖子: 49
注册时间: 2008-03-29 17:33

Re: sudo 不能正常使用,麻烦看下

#6

帖子 mengkeq » 2009-03-23 7:29

自己往上顶下.
笨鸟也要飞........
头像
bones7456
帖子: 8495
注册时间: 2006-04-12 20:05
来自: 杭州
联系:

Re: sudo 不能正常使用,麻烦看下

#7

帖子 bones7456 » 2009-03-23 8:24

chown root:root /etc/sudoers
这个你执行成功了吗?
关注我的blog: ε==3
头像
lerosua
论坛版主
帖子: 8455
注册时间: 2007-11-29 9:41
联系:

Re: sudo 不能正常使用,麻烦看下

#8

帖子 lerosua » 2009-03-23 8:50

嗯,sudoers文件的权限被改了
头像
懒蜗牛Gentoo
论坛版主
帖子: 7351
注册时间: 2007-03-02 17:36
系统: Linux Mint

Re: sudo 不能正常使用,麻烦看下

#9

帖子 懒蜗牛Gentoo » 2009-03-23 9:27

你不能sudo,怎么执行的
chown root:root /etc/sudoers
chmod 0440 /etc/sudoers
这两句??
虽然世上没有完美的东西,但这并不影响我们追求完美,因为只有偏执狂才TMD能成功。
10.04新手入门——笨兔兔讲述自己的故事
ygf
帖子: 458
注册时间: 2006-11-27 12:25

Re: sudo 不能正常使用,麻烦看下

#10

帖子 ygf » 2009-03-23 21:23

你是不是改了root所属的组啊?
id root看一下。
头像
mengkeq
帖子: 49
注册时间: 2008-03-29 17:33

Re: sudo 不能正常使用,麻烦看下

#11

帖子 mengkeq » 2009-03-25 20:54

bones7456 写了:chown root:root /etc/sudoers
这个你执行成功了吗?
这两天有事出去了,不好意思。
这句执行后系统没的提示,我不知道是不是成功了
笨鸟也要飞........
头像
mengkeq
帖子: 49
注册时间: 2008-03-29 17:33

Re: sudo 不能正常使用,麻烦看下

#12

帖子 mengkeq » 2009-03-25 20:55

懒蜗牛Gentoo 写了:你不能sudo,怎么执行的
chown root:root /etc/sudoers
chmod 0440 /etc/sudoers
这两句??
su进入root用户使用
笨鸟也要飞........
poet
帖子: 2841
注册时间: 2006-09-11 22:47

Re: sudo 不能正常使用,麻烦看下

#13

帖子 poet » 2009-03-25 20:56

ls -l /etc/sudoers 看看
头像
mengkeq
帖子: 49
注册时间: 2008-03-29 17:33

Re: sudo 不能正常使用,麻烦看下

#14

帖子 mengkeq » 2009-03-25 20:57

ygf 写了:你是不是改了root所属的组啊?
id root看一下。
id root结果是

代码: 全选

uid=0(root) gid=1002(root) 组=1002(root)
,不知道有问题没,望指教。
笨鸟也要飞........
ygf
帖子: 458
注册时间: 2006-11-27 12:25

Re: sudo 不能正常使用,麻烦看下

#15

帖子 ygf » 2009-03-25 21:47

你更改了root组的id,不知道你做过什么操作,因为root组的id默认是0(零)的。把它改回来就行了:(当然你要有root权限做如下操作):
groupmod -g 0 root
回复