LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-06-2010, 05:08 AM   #1
alok.rhct
Member
 
Registered: Dec 2005
Posts: 75

Rep: Reputation: 16
SUDO permission setup on particular dir , recursive


Hi,
I am looking for a way to setup sudo access for a user, so that he can change permission of all files of the given dir.

eg:
userA /bin/chown -[vR] [a-z]\:[a-z] /etc/userA-conf/*

By this user can change ownership of files which are on depth bellow to given dir (i.e /etc/userA-conf/), but while trying to change permission of /etc/userA-conf/../user-conf2 , getting error,
user userA don;t have that permission.

Let me know what will be the right regex/pattern to achieve this.
In Solaris it's working fine, but I am trying it on Linux RHEL5.

Let me know in case some more details is required to understand this my issue.

Thanks
Alok
 
Old 05-07-2010, 09:49 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by alok.rhct View Post
Hi,
I am looking for a way to setup sudo access for a user, so that he can change permission of all files of the given dir.

eg:
userA /bin/chown -[vR] [a-z]\:[a-z] /etc/userA-conf/*

By this user can change ownership of files which are on depth bellow to given dir (i.e /etc/userA-conf/), but while trying to change permission of /etc/userA-conf/../user-conf2 , getting error,
user userA don;t have that permission.

Let me know what will be the right regex/pattern to achieve this.
In Solaris it's working fine, but I am trying it on Linux RHEL5.

Let me know in case some more details is required to understand this my issue.

Thanks
Alok
Code:
## Command Aliases
## These are groups of related commands...
Cmnd_Alias CHMOD = /bin/chmod

and

Code:
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
user   ALL = CHMOD
 
Old 05-07-2010, 10:01 AM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
i need to correct the above post.

you would have to add

Code:
Cmnd_Alias CHMOD = /bin/chmod permissions /directory/*, Cmnd_Alias CHMOD = /bin/chmod * /directory/*
for any instance of the chmod command to be ran by the particular user.
there is possibly a shorter way, but i have tested this way and it works.
 
1 members found this post helpful.
Old 05-18-2010, 06:32 AM   #4
alok.rhct
Member
 
Registered: Dec 2005
Posts: 75

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by centosboy View Post
i need to correct the above post.

you would have to add

Code:
Cmnd_Alias CHMOD = /bin/chmod permissions /directory/*, Cmnd_Alias CHMOD = /bin/chmod * /directory/*
for any instance of the chmod command to be ran by the particular user.
there is possibly a shorter way, but i have tested this way and it works.
Sure i will try that..

I've managed it by putting exact user and group name for chown.

I will try it by replacing them with * . Hope it will allow user to set ownership to any on given dir.

Thanks for your time..
 
  


Reply

Tags
setup, sudo



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
PATH, dot dir, and sudo yogaboy2 Linux - General 5 07-06-2009 08:14 PM
Permission Help on a New Dir? carlosinfl Linux - General 2 06-22-2007 09:11 AM
Recursive Delete DIR and Sub Dir with CONTENTS jCash Linux - Newbie 1 05-14-2007 05:54 PM
sudo - permission denied! yogaboy Linux - Newbie 5 12-28-2006 11:58 PM
rox + recursive permission change for FILES only? NonSumPisces Linux - Newbie 9 08-11-2004 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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