Transparently sharing dir and files

Kihara Muriithi william.muriithi-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Jan 17 18:31:30 UTC 2006


Thanks
 I knew I was going around it the wrong way. There was just too much
work and I got permission issues.
  >  # chgrp accounting /data/accounting
  That is one command I missed from "apropos group" and it made a
whole lot of a difference. I only notices usermod which does an
equivalent jobs on users.
>  # chmod 2770 /data/accounting
Opps, I did 4000 which is setuid, but we shared the intention behind
introducing the *000. I am however surprised you didn't give others
any rights to the group. Wouldn't that prevent some applications
reading directories on /data/accounting?
>  Any files created in /data/accounting by these three users will
> automatically have group ownership of "accounting" (that's what the setgid
However, whenever I create a file, its always created on my home
directory by default. Yeah, I do point it to other directories, but I
think most users save them on home directory. That would make the
setgid ineffective since the files will always be created elsewhere
and then moved on /data/accounting later.
 Thanks again, I think I have to do more work to wean myself from the
GUI for some work.

William
On 1/17/06, Paul Mora <paulmora-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> 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
>
>
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list