Transparently sharing dir and files
Paul Mora
paulmora-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Jan 17 17:14:05 UTC 2006
Hi.
I'm not sure why you're going through all this trouble to share files.
Red Hat uses a user/group scheme called "user private groups". With this
scheme, every user gets his own group (usually of the same name and ID as
the user).
If you want to have several users share data in a common directory, the
admin can set this up using the setgid bit.
Example scenario:
Three users (tom, dick, harry) all members of the accounting group need to
be able to share files with each other, on a Red Hat / Fedora system.
Step 1: As root, create the group and common directory and change the
permissions and group ownership.
# groupadd accounting
# mkdir /data/accounting
# chgrp accounting /data/accounting
# chmod 2770 /data/accounting
Step 2: Create the users and add the accounting group to their group set
# useradd -G accounting tom
# useradd -G accounting dick
# useradd -G accounting harry
Any files created in /data/accounting by these three users will
automatically have group ownership of "accounting" (that's what the setgid
bit does). Anywhere outside this dir, and everything is back to normal (ie.
files get user and private group ownership). Distributions that use user
private group schemes usually set their umask (default file permissions) to
002, which makes your default file permissions rw-rw-r-- and directories
rwxrwxr-x. So any files created in the shared directory can be modified by
users in the group.
pm
--
Paul Mora
email: paulmora-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20060117/e6431b55/attachment.html>
More information about the Legacy
mailing list