LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-01-2010, 09:07 AM   #1
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
sudoers question about cmnd_alias/list and directories.


I need to create a cmnd_alias that permits a handful of directories and all the commands that reside in that directory. but Cmnd_Alias seems to be ignoring directories.

I notice in the sudoers man page a Cmnd_List which supports directories but the syntax is a little confusing.

Here is what I would like to have working:
Code:
Cmnd_Alias TMP123 = /dir1, /dir2, /dir3

%mygroup ALL=(myuser) NOPASSWD: TMP123
That does not work the way I expect it to.

Here is what I am currently doing:
Code:
%mygroup ALL=(myuser) NOPASSWD: /dir1, /dir2, /dir3
This works but what I am giving you is only a snippet, I have dozens and dozens of groups users, and cmnd_alias I would like to setup. So using the above would get cumbersome without the Alias's working if I needed to make an edit.... or add a directory.

Any ideas?
 
Old 12-01-2010, 02:12 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by trey85stang View Post
I notice in the sudoers man page a Cmnd_List which supports directories (..)
'man sudoers' says that a directory is a fully qualified pathname ending in a '/'.

That works for me:
Code:
Cmnd_Alias DIRECTORIES = /sbin/, /bin/
username fqdn=DIRECTORIES
Code:
]$ sudo -l
User username may run the following commands on this host:
    (root) /sbin/, /bin/
sudo-1.7.2p1-9.el5_5 here.
 
Old 12-02-2010, 03:59 PM   #3
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Original Poster
Rep: Reputation: 41
Thanks for reply... That worked, I dont know why I did not catch that.
 
  


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
How do I add myself to the sudoers list? Cultist Debian 6 07-26-2010 06:31 PM
Cmnd_Alias entries in sudo Quakeboy02 Linux - Security 3 01-11-2010 01:00 AM
sudoers list Pedroski Fedora 4 11-06-2009 10:20 AM
sudoers - how to give access to certain directories? trey85stang Linux - Enterprise 4 05-23-2009 02:30 PM
sudo - problem with cmnd_alias slackware stu Linux - Software 0 10-04-2003 12:48 AM

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

All times are GMT -5. The time now is 07:58 AM.

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