How to set up chmod/chown to work in a specific directory?

Chen, Sunny sunny.chen at eds.com
Mon Jun 25 14:28:31 EDT 2001


Hello,

Recently, I need to install sudo and edit sudoer file for our security team.
I only want the security team to be able to use "chmod" and "chown" in
/export/home directory only, however, if I set up the sudoer file as:

# Cmnd alias specification
Cmnd_Alias CHMODHOME=/usr/bin/chmod /export/home/[A-z]*/
Cmnd_Alias CHOWNHOME=/usr/bin/chown /export/home/[A-z]*/

The "chmod" and "chown" commands won't work (I kept getting the warning
messages that user can't execute "chmod" or "chown" as root when I was
testing the configuration).  Please also notice that I was testing on
Solaris 2.6, 7 and 8, none of the commands were working.

I also used the following settings for "chmod" and "chown":

# Cmnd alias specification
Cmnd_Alias CHMODHOME=/usr/bin/chmod /export/home/[A-z]*
Cmnd_Alias CHOWNHOME=/usr/bin/chown /export/home/[A-z]*

OR

# Cmnd alias specification
Cmnd_Alias CHMODHOME=/usr/bin/chmod /export/home/
Cmnd_Alias CHOWNHOME=/usr/bin/chown /export/home/

But still, these settings don't work for "chmod" and "chown".

Then I use the following setting:

# Cmnd alias specification
Cmnd_Alias CHMODHOME=/usr/bin/chmod 
Cmnd_Alias CHOWNHOME=/usr/bin/chown 

This time, "chown" and "chmod" will work, but it works for ANY directories.

Can anyone tell me how to make "chmod" and "chown" to work in /export/home
only?

Thanks,

Sunny

+ mailto:sunny.chen at eds.com





More information about the sudo-users mailing list