You are not logged in.
Trying to do something with sudo, it returns:
>>> /etc/sudoers: syntax error near line 5 <<<
sudo: parse error in /etc/sudoers near line 5
sudo: no valid sudoers sources found, quitting
My /etc/sudoers:
Defaults env_reset
root ALL=(ALL) ALL
alex ALL=(ALL) ALL
Defaults:alex timestamp_timeout=0
Where is my error?
Last edited by Mr. Alex (2010-10-29 14:20:42)
Offline
What's that "alex" doing in the defaults line?
Offline
It's there for disabling 15 minutes "sudo" acception without alex password.
Offline
I misread, that's indeed correct syntax. Sorry, can't help you further I'm afraid.
Offline
Try to comment every single line and check out. Have you edited the file in the last time?
Offline
> Try to comment every single line and check out.
Tried to comment one, then another... Until I commented all of them. Still error near line 5...
> Have you edited the file in the last time?
Yes, just today, after installing Arch (I was reinstalling it).
Just noticed that I have "/etc/sudoers.d" directory which contains nothing. Maybe I should do something with it?
Offline
Mine is empty, too. do you have a sudoers.pacnew? try this one.
EDIT:
I dunno whether it makes a difference or not,...did you use visudo? Maybe it troubles editing 'manually' via "<editor> /etc/sudoers".
Last edited by linux-ka (2010-10-29 14:30:21)
Offline
No, I don't. Can you post your sudoers file for me to try?
Offline
this is my current sudoers.pacnew....looks a bit weird. the early versions have been more clear...
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##
##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias WEBSERVERS = www1, www2, www3
##
## User alias specification
##
## Groups of users. These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias ADMINS = millert, dowdy, mikef
##
## Cmnd alias specification
##
## Groups of commands. Often used to group related commands together.
# Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# /usr/bin/pkill, /usr/bin/top
##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods. Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!/sbin/reboot !log_output
##
my current sudoers file:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
Last edited by linux-ka (2010-10-29 14:34:59)
Offline
I tried this and it returns error near line 68 this time.
What version of sudo do you have in your system? Mine is 1.7.4.p4-1.
Offline
Try hitting enter on the last line of the file
Offline
That helped! Thanks! I pretty sure I didn't have this "sudo" peculiarity before...
Do all the Arch config files need this "enter in the end of file"?
Last edited by Mr. Alex (2010-10-29 15:11:09)
Offline
No, but I guess thats why you should use visudo to edit sudoers
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
Offline
btw, I've got:
Sudo version 1.7.4p4
Offline