LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


I have edited /etc/sudoers as followes:
Code:
# 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
Host_Alias   MICOplus=FAST21.mailserver.com, FAST22.mailserver.com
Host_Alias   LINUXHELP=receiver.groupultra.com, thete.logicacmg.com
# 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
PARTTIME ALL=SERVICE
# 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:
Code:
[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
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466

Original Poster
Blog Entries: 6

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

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:08 PM.

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