Yeah, I know how groups / permissions work. What I was wondering, is there a way to set a sticky bit recursively, so that no matter what the default group of a user is, any file or directory that the user creates in a certain directory will be set to the group of that directory. I don't want to have too chmod and chgrp on all files / directories that these users create. Example...

I have two users....

jschmoe
jdoe

Both users default group is the same as their user name, and they also belong to a group named 'www'. Now, when either jschmoe or jdoe creates a file in their home directory, it will be.....

-rw-r--r-- 1 jschmoe jschmoe
-rw-r--r-- 1 jdoe jdoe

However, when either one of these users creates a file in a directory (or below) called 'webserver', the permissions / owner / group will be....

-rw-rw-r-- 1 jschmoe www
-rw-rw-r-- 1 jdoe www

I'm pretty sure this is possible, but I just can't figure out how to do it.

David Kramer wrote:
On Saturday 28 December 2002 01:00 pm, John Nichel wrote:

Hello fellow RedHatters,

  Can someone tell me if it's possible to set a sticky bit recursively
on a directory?  What I'm looking to do is to have multiple users
creating files and directories in a certain place, and I want those
files / directories to be group readable / writeable, and belonging to a
common group.  I would like to do this without changing the default
group for each user (so that they can still put stuff in their home
directory without it belonging to the common group.

To answer your question directly, chmod has a -R option to work recursively, or you can use something like "find . | xargs chmod u+s" if you want to work on only some files.

However, there are other ways of doing what you want. For instance you can make all the files owned by group 'foo', and all the concerned users members of group 'foo'. Before they work on these files, they type in "newgrp foo" to make 'foo' their current default group.
----------------------------------------------------------------------------
DDDD David Kramer [EMAIL PROTECTED] http://thekramers.net
DK KD DKK D If you're so special, why aren't you dead?
DK KD - The Breeders
DDDD



--
By-Tor.com
It's all about the Rush
http://www.by-tor.com



--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to