Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-13-2009, 05:01 AM   #1
Senior Member
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,462
Blog Entries: 6

Rep: Reputation: 51
parse error in /etc/sudoers near line 8 ??

I have edited /etc/sudoers as followes:
# sudoers file.
# This file MUST be edited with the 'visudo' command as root.
# See the sudoers man page for the details on how to write a sudoers file.

# Host alias specification
# User alias specification
User_Alias ADMINS = joe, bill, jake
User_Alias PARTTIME = jim,jeff,mike
User_Alias LINUXGROUP = lyte, sirplaya
# Cmnd alias specification
Cmnd_Alias      BROWSE = /bin/ls, /bin/cd, /bin/cat
Cmnd_Alias      KILL = /bin/kill
Cmnd_Alias      USERS = /usr/sbin/adduser [A-z]*,/usr/sbin/userdel -r [A-z]*
Cmnd_Alias      SERVICE = /etc/init.d/sshd restart
# Defaults specification

# User privilege specification
root    ALL=(ALL) ALL

#---------------------------EXPLORING USAGE OF SUDO------------------------------------------------#
#This allows the users in the PARTTIME alias (jim,jeff,mike) to do all of the commands listed in USERS,KILL,SERVICE and       BROWSE aliases on all servers. In addition to that, they may run /usr/bin/passwd followed by a 1 letter word or more        (username of password to change) but the last option says that they CANNOT change root's password.
#! is used to represent the word "NOT"
#-------------------------------END DOC------------------------------------------------------------#

PARTTIME ALL=USERS,KILL,BROWSE,/usr/bin/passwd [A-z]*, !/usr/bin/passwd root
# 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
# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now
When I logged in as jim opening another terminal it says:
[jim@receiver ~]$ sudo ls
>>> sudoers file: syntax error, line 8 <<<
sudo: parse error in /etc/sudoers near line 8
[jim@receiver ~]$
Old 05-13-2009, 05:21 AM   #2
Senior Member
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,462
Blog Entries: 6

Original Poster
Rep: Reputation: 51
Sorry I made it correct.
I had combination of small and capital letters for Hosts_Alias. I edited :
And everything worked fine.
Old 05-13-2009, 08:24 AM   #3
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Note that you should use visudo instead which checks for correct syntax before commiting the file to the disk.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error syntax error unexpected '{ ' on line chakaox Programming 2 04-29-2009 03:27 AM
PHP Error Parse error: parse error, unexpected $ in /home/content/S/k/i/SkinCare4U/h CowanServices Programming 2 12-09-2008 08:26 PM
parse error in /etc/sudoers near line -1 RAFAL Linux - Newbie 2 11-10-2008 10:56 AM
/etc/sudoers parse error Alfiow Linux - Newbie 2 11-02-2008 10:05 AM
NVIDIA...Parse error on line 13 of section Mandrake 9.0 serok Linux - Newbie 2 11-08-2003 10:54 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration