LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-02-2007, 07:05 PM   #1
Julix
LQ Newbie
 
Registered: Aug 2007
Location: Argentina
Distribution: Debian Etch, Slackware 12
Posts: 28

Rep: Reputation: 15
Unhappy Syntax error in sudoers file


Hi Everybody,

I recently moved to Slackware 12 and noticed that the sudo logs are send to the mailbox of root, for example if a user tries to use SUDO and is not defined in the SUDOERS file, an incident report is send to root. I would like to change that the this kind of mails goes to my user account just to avoid using root as least as possible. I have tried to put the something like DEFAULT MAILTO = "me@host" but I keep getting syntax error. Does anyone know how set it correctly?

Thanks and regards,

Julix
 
Old 09-02-2007, 07:23 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I suppose it's possible you have a somewhat different sudo implementation/version (?), but on my CentOS 4 box, man 5 sudoers shows:
Quote:
mailto
Address to send warning and error mail to. The address
should be enclosed in double quotes (") to protect against
sudo interpreting the @ sign. Defaults to root.
I haven't tested this, but I'd interpret that to mean:
mailto = "some@email.address"

Good idea editing with visudo, by the way. A syntax error at save/parse time is a lot better than a broken sudo.

------------ edit ----------------------------------------

Ok, I was wrong. But this passes the syntax check:
Defaults mailto = "some@email.address"

I haven't tested the actual functionality. Hopefully that'll be the one.

Last edited by anomie; 09-02-2007 at 07:31 PM. Reason: oops.
 
Old 09-02-2007, 07:33 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Have you tried without the word default? What exactly does your line
look like?


Cheers,
Tink
 
Old 09-02-2007, 08:27 PM   #4
Julix
LQ Newbie
 
Registered: Aug 2007
Location: Argentina
Distribution: Debian Etch, Slackware 12
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks all for your replies,

My user account is julix, and the hostname is jtlx
actually the line look exactly like this:

default mailto = "julix@jtlx"

i have tried it without "default" :

mailto = "julix@jtlx"

,but I still get the syntax error message

Regards,

Julix
 
Old 09-02-2007, 09:17 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Neither of those passes my syntax checker. Try the second suggestion I mentioned above.
 
Old 09-02-2007, 10:35 PM   #6
Julix
LQ Newbie
 
Registered: Aug 2007
Location: Argentina
Distribution: Debian Etch, Slackware 12
Posts: 28

Original Poster
Rep: Reputation: 15
I have entered the line

Defaults mailto = "julix@jtlx" and it passed the syntax on the sudoers file,I had to put the d in upper case. STUPID ME!!!! But when I test with another user account who is not on the sudoers file to execute as SUDO, the system does not send the mail with the incident report to my account julix nor to the root. I have looked in the man page and add the parameter mail_no_user. The line would be look like this Defaults mail_no_user mailto = "julix@jtlx but then I get the syntax error again .
Anomie, my apologies if I am wrong but I think you are saying to try something like example Default mailto ="user@myisp.com", well what I want is that the reports donīt go to some email address but to my account mail within my linuxbox.

Regards,

Julix

Last edited by Julix; 09-03-2007 at 09:08 AM. Reason: forgot to add one more thing
 
Old 09-03-2007, 08:56 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
One more comment from me, and if it doesn't work I may have to do some real testing.

Have you tried simply:
Defaults mailto = "julix"

??
 
Old 09-05-2007, 10:35 AM   #8
Julix
LQ Newbie
 
Registered: Aug 2007
Location: Argentina
Distribution: Debian Etch, Slackware 12
Posts: 28

Original Poster
Rep: Reputation: 15
I have tried the Defaults mailto= "julix" entry, it passes the syntax verification but it wonīt send the notification to my account. Maye I have to add some additional parameters
 
Old 09-07-2007, 05:18 PM   #9
Julix
LQ Newbie
 
Registered: Aug 2007
Location: Argentina
Distribution: Debian Etch, Slackware 12
Posts: 28

Original Poster
Rep: Reputation: 15
Talking Found the problem!!!

When I setup Slackware in my box, I didnīt enable the sendmail daemon. I have enabled it now and the issue has been solved.

Regards
 
Old 09-07-2007, 09:44 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Oh dear :}


Well, glad you found the solution in the end ;}


Cheers,
Tink
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Error Suders file Asteroid Linux - General 1 08-03-2007 02:17 AM
/usr/bin/lesspipe: line 223: syntax error: unexpected end of file fakie_flip Linux - Software 1 09-06-2006 02:22 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
sudo and sudoers syntax mikemrh9 Linux - Security 7 06-04-2005 07:54 PM
ndiswrapper throws syntax error when I try to run with my .inf file pfatts Linux - Wireless Networking 8 10-01-2004 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:31 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