You are not logged in.

#1 2011-10-02 16:24:15

nankura
Member
Registered: 2011-08-02
Posts: 166

Sudo error

Hey guys, ok basically sudo isnt working for me right now and i cant figure out why

error

sudo: >>> /etc/sudoers: syntax error near line 89 <<<
sudo: parse error in /etc/sudoers near line 89
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

P.S i noticed include sudoers.d was uncommented, so i commented it out and recieved thi

sudo: /etc/sudoers is mode 0551, should be 0440
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

my 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
##
## 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
##
# 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"
##
## .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

##
## Runas alias specification
##

##
##
## User privilege specification
##
root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
#Defaults targetpw  # Ask for the password of the target user
#ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d

Last edited by nankura (2011-10-02 16:25:53)

Offline

#2 2011-10-02 16:39:15

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Sudo error

The /etc/sudoers file that you posted doesn't have a line 89; It ends at line 85. Do you have something above or below what you posted?

--EDIT--

My copy has only 32 lines and I only added one myself. Is your system up to date?

Last edited by skottish (2011-10-02 16:45:31)

Offline

#3 2011-10-02 17:30:21

roygbiv
Member
Registered: 2011-05-18
Posts: 204

Re: Sudo error

Did edit the file using visudo?

Offline

#4 2011-10-02 18:02:02

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Sudo error

roygbiv wrote:

Did edit the file using visudo?

+1.  There is a good chance that this didn't happen.


I laugh, yet the joke is on me

Offline

#5 2011-10-02 23:24:56

nankura
Member
Registered: 2011-08-02
Posts: 166

Re: Sudo error

yeah at the time i didnt edit with visudo. i used nano at the CLI after ncurses ( fresh install ) . ive never had this problem before and ive reinstalled countless times and used nano for sudo.

but i still cant see were this error is because theres no extra lines beyond 85

Offline

#6 2011-10-03 04:35:44

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Sudo error

Try a clean 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
##
## 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

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo	ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw  # Ask for the password of the target user
# ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d

Offline

#7 2011-10-03 12:46:40

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Sudo error

anonymous has probably your best solution.  Just start over since you don't have much in the way of modifications in your file.  BTW, you can use nano to edit, just do it this way:

EDITOR=nano visudo

Edit:

The line 89 error probably was the uncommented includedir /etc/sudoers.d line.  However, when you edited it, you created the new problem:

sudo: /etc/sudoers is mode 0551, should be 0440
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

And that occurred because of how you edited sudo.

Last edited by the sad clown (2011-10-03 12:57:58)


I laugh, yet the joke is on me

Offline

#8 2011-10-03 13:28:40

nankura
Member
Registered: 2011-08-02
Posts: 166

Re: Sudo error

Ok thanks guys, using visudo fixed everything and its running fine now

Just a quick addition: i remember a long time ago i had to add XAUTH or XAUTHORITY to a line in the sudoers file. i cant remember were in the file or why, any advisement would be appreciated

Last edited by nankura (2011-10-03 13:28:58)

Offline

#9 2011-10-03 13:40:17

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Sudo error

You added it to env_keep. A better solution to be to avoid running programs as root.

Offline

Board footer

Powered by FluxBB