1833988 Members
1726 Online
110063 Solutions
New Discussion

Re: Question about sudo

 
someone_4
Honored Contributor

Question about sudo

Hi all

I have a quick question about sudo.
I have a directory called /homepages.

Is there a way that I can give user1 root privilages only in the /homepages direcotry and all of the sub dirs but no where else?

Or is there a way to limit rm -rf only in the /homepages direcotry and all of the sub dirs but no where else?

Thanks
Richard
2 REPLIES 2
David Child_1
Honored Contributor

Re: Question about sudo

Richard,

One way to go is create a wrapper script that would basically do something like (we'll call the script: rmscript):

BASE=/homepages
rm -rf ${BASE}/$1

It could then be run like:

$ sudo rmscript subdir1

Some major tweaking is in order, but you get the idea.

P.s. make sure they don't have write access to the script or directory it is in.

David
Patrick Wallek
Honored Contributor

Re: Question about sudo

Instead of sudo you should probably be looking at ACL (access contol lists) for something like this.