Unix administration - SUDO - sudoers syntax

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > March 2005 > SUDO - sudoers syntax





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SUDO - sudoers syntax
kona_iron@yahoo.fr

2005-03-10, 6:00 pm

Hello,
A new question about sudoers !!!
My sudoers file have the following line :

Cmnd_Alias LOG_CMD = /usr/bin/cat, /usr/bin/more, /usr/bin/ls

It works :
USER_LOG HOST = NOPASSWD: LOG_CMD

But I get a syntax error in this case :
USER_LOG HOST = NOPASSWD: LOG_CMD /opt/IBM/soft/*


sudo ls -al /opt/IBM/soft[vbcol=seagreen]
sudo: parse error in /etc/sudoers near line 115

Question : can I give a argument to a Cmd_Alias ?

Regards

Greg Beeker

2005-03-10, 6:00 pm


kona_i...@yahoo.fr wrote:
> Hello,
> A new question about sudoers !!!
> My sudoers file have the following line :
>
> Cmnd_Alias LOG_CMD = /usr/bin/cat, /usr/bin/more, /usr/bin/ls
>
> It works :
> USER_LOG HOST = NOPASSWD: LOG_CMD
>
> But I get a syntax error in this case :
> USER_LOG HOST = NOPASSWD: LOG_CMD /opt/IBM/soft/*


Try not using a special character like '*' in the argument

>
>
> sudo ls -al /opt/IBM/soft
> sudo: parse error in /etc/sudoers near line 115
>
> Question : can I give a argument to a Cmd_Alias ?
>
> Regards


Kevin Collins

2005-03-10, 6:00 pm

In article <1110468865.127240.107180@z14g2000cwz.googlegroups.com>,
kona_iron@yahoo.fr wrote:
> Hello,
> A new question about sudoers !!!
> My sudoers file have the following line :
>
> Cmnd_Alias LOG_CMD = /usr/bin/cat, /usr/bin/more, /usr/bin/ls
>
> It works :
> USER_LOG HOST = NOPASSWD: LOG_CMD
>
> But I get a syntax error in this case :
> USER_LOG HOST = NOPASSWD: LOG_CMD /opt/IBM/soft/*
>
>
> sudo ls -al /opt/IBM/soft
> sudo: parse error in /etc/sudoers near line 115
>
> Question : can I give a argument to a Cmd_Alias ?


I don't think that works - you should be able to do this:

Cmnd_Alias LOG_CMD = /usr/bin/cat /opt/IBM/soft/*, \
/usr/bin/more /opt/IBM/soft/*, \
/usr/bin/ls /opt/IBM/soft/*

USER_LOG HOST = NOPASSWD: LOG_CMD

Kevin
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com