The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sudo question melias Security 12 05-26-2008 01:10 AM
sudo, or not sudo: that is the question iBot UNIX and Linux RSS News 1 02-07-2008 10:40 AM
Sudo question Zarnick Linux 2 01-22-2008 05:25 AM
Sudo question Katkota UNIX for Dummies Questions & Answers 10 01-18-2008 02:35 AM
sudo question TRUEST UNIX for Dummies Questions & Answers 1 01-16-2004 09:53 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-10-2005
Registered User
 

Join Date: Sep 2004
Posts: 8
SUDO question - please help

Hi, I was wondering if someone can give me some pointers about configuring SUDO. I am trying to configure SUDO to have about 30 users run about 200 scripts as a different user. I understand that I can create an User_Alias but how do I give that User_Alias rights to run all the scripts in a certain directory? We add scripts to that directory every week and don't want to keep a static Cmnd_Alias . Does that make sense? Your help is appreciated very much.

Jake
Reply With Quote
Forum Sponsor
  #2  
Old 02-11-2005
Registered User
 

Join Date: Aug 2004
Posts: 232
Why not make a group; [scripts], add those users who are permitted to run these scripts to this group. Then they can just su to that group to run those scripts.
Everytime you create a new script, just change the owner to that group.
Reply With Quote
  #3  
Old 02-11-2005
Registered User
 

Join Date: Sep 2004
Posts: 8
Pardon my ignorance, but how do you su to a group? One can SU to another user but how does that work for a group?
Reply With Quote
  #4  
Old 02-11-2005
Registered User
 

Join Date: Aug 2004
Posts: 232
Yes. Correction.

My mistake, I usually create a dummy user, such as script, which is usually in a group called script, then I just su script.

You would need to use the command newgrp to change to a different group.
Reply With Quote
  #5  
Old 02-12-2005
Registered User
 

Join Date: Feb 2005
Location: Holon, Israel
Posts: 25
create wrapper script which will change to the directory where your scripts reside and run specified script (input parameter) from the current directory (so, that wrapper limits running scripts from specific directory). Wrapper owner must be root and permissions must be set to 700.
In sudo configuration you will need to define permissions only for the wrapper script.
Your users wil run scripts in following manner:

mypath/mywrapper myscript parm1 parm3 .... parmN
Reply With Quote
  #6  
Old 04-27-2005
Registered User
 

Join Date: Apr 2005
Location: McKinney, TX
Posts: 11
Quote:
Originally Posted by sajjad02
I understand that I can create an User_Alias but how do I give that User_Alias rights to run all the scripts in a certain directory?
Use this syntax to allow sudo access to an entire directory:

Code:
User_Alias  Host_Alias = (ALL) directory/
where
User_Alias is your User_Alias, userid, group, netgroup, or ALL
Host_Alias is your Host_Alias, host, netgroup, or ALL
directory is the directory conatining all your scripts

The key to this is to make sure to put the slash ( / ) on the end of your directory entry, as in " /usr/global/bin/ "
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0