分页: 1 / 2

[问题]sudo无法使用

发表于 : 2008-07-15 14:50
lingai521
各位大虾:
小弟俺刚接触ubuntu,今天装了8.04版,我也么去修改什么文件,到后来sudo不能使用了,不知道是出了什么问题,提示如下:
>>> sudoers file: syntax error, line 12 <<<
sudo: parse error in /etc/sudoers near line 12

我该怎么去修改才能使用sudo???????????急!!!!!
希望哪位大虾指导。

发表于 : 2008-07-15 15:01
solcomo
进入recovery mode
visudo
看看/etc/sudoers的第12句有什么问题

发表于 : 2008-07-15 15:02
Nile
先su root

再visudo,12行语法错了

[问题]sudo无法使用

发表于 : 2008-07-15 15:09
lingai521
recovery mode
bash: recovery:找不到命令

发表于 : 2008-07-15 15:17
solcomo
按3楼的方法
要不还得重启

[问题]sudo无法使用

发表于 : 2008-07-15 15:26
lingai521
:~$ su root
口令:
su:鉴定故障
victory@ares:~$ visudo
visudo: /etc/sudoers: Permission denied

Re: [问题]sudo无法使用

发表于 : 2008-07-15 15:33
Nile
lingai521 写了::~$ su root
口令:
su:鉴定故障
victory@ares:~$ visudo
visudo: /etc/sudoers: Permission denied
确定你输入的是root密码

发表于 : 2008-07-15 15:38
lingai521
但是我安装ubuntu的时候没有要设置root用户密码,不知道默认密码是多少,空的也是那样的提示

发表于 : 2008-07-15 15:41
Nile
没辙了

重启进recovery mode吧

发表于 : 2008-07-15 15:44
delectate
lingai521 写了:但是我安装ubuntu的时候没有要设置root用户密码,不知道默认密码是多少,空的也是那样的提示
没设置肯定鉴定错误啊

sudo passwd root

设置root密码再试试

发表于 : 2008-07-15 15:46
delectate
先执行 su
输入口令
再gedit /etc/sudoers

我这里12行是空的,什么都没有,不知道lz你哪里有什么错误……

贴一下:


# /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

发表于 : 2008-07-15 15:47
lingai521
# /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
"/etc/sudoers.tmp" 33 lines, 797 characters


打开了,画面是这样的,请指导。

发表于 : 2008-07-15 15:52
BigSnake.NET
修改 sudoers 文件必须用 root 身份
成为 root 有两个办法, 一个是su,需要root密码,但是默认没有设所以不能使用su。第二个办法是用sudo,但是sudo已经出故障了。

所以唯一的办法是重启进 recovery mode , 然后用 visudo 修改 sudoers

[问题]sudo无法使用

发表于 : 2008-07-15 16:00
lingai521
# /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

# Entries for Smb4K users.
# Generated by Smb4K. Please do not modify!
User_Alias SMB4KUSERS = victory
Defaults:SMB4KUSERS env_keep += "PASSWD USER"
SMB4KUSERS ares = NOPASSWD: /usr/bin/smb4k_kill
SMB4KUSERS ares = NOPASSWD: /usr/bin/smb4k_umount
SMB4KUSERS ares = NOPASSWD: /usr/bin/smb4k_mount
# End of Smb4K user entries.
~
我要怎么样修改才可以用啊

Re: [问题]sudo无法使用

发表于 : 2008-07-15 16:02
BigSnake.NET
lingai521 写了:# /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

# Entries for Smb4K users.
# Generated by Smb4K. Please do not modify!
User_Alias SMB4KUSERS = victory
Defaults:SMB4KUSERS env_keep += "PASSWD USER"
SMB4KUSERS ares = NOPASSWD: /usr/bin/smb4k_kill
SMB4KUSERS ares = NOPASSWD: /usr/bin/smb4k_umount
SMB4KUSERS ares = NOPASSWD: /usr/bin/smb4k_mount
# End of Smb4K user entries.
~
我要怎么样修改才可以用啊
多了行 ALL