Results 1 to 2 of 2

Thread: Problems with sharing a directory amongst multiple users (permissions are preserved)

  1. #1
    Join Date
    Jun 2006
    Location
    The Netherlands
    Beans
    Hidden!

    Problems with sharing a directory amongst multiple users (permissions are preserved)

    The problem
    The most problematic issue I've encountered in trying to make a locally shared directory is that copying files/directories into the shared directory will preserve the existing permissions, both using standard UGO permissions and POSIX ACLs. Manually or even using a cronjob to correct the permissions is obviously not a solution. Also note that I cannot tell the end-user to copy without preserving permissions, I don't have that much control over them.

    If somebody were able to present a solution for this issue I'd be satisfied.

    I'll summarize several methods which one can use to create a shared directory.

    Common methods for sharing directories

    Using standard UGO permissions

    • Set a default umask of 002 in /etc/login.defs (i.e. umask u=rwx,g=rwx,o=rx
    • Add users to a shared group
    • Create a directory
    • Change the group of the directory to the shared group
    • chmod g+s the directory (the setgid bit, the group will be inherited for any created directory/file inside the directory)


    However this method is a little bit too inflexible for certain scenarios.

    Using POSIX ACLs
    For a more extensive discussion, see the following posts: HOWTO: Local shared folder and Re: Permissions on a shared directory.

    • Create a directory
    • Change the ACLs and default ACLs to allow a shared group (in this case foo) read/write access
      • setfacl -m g:foo:rwx && setfacl -dm g:foo:rwx


    The default ACL will take care of the permissions.

    References

    General references
    Here are some links that should give you some more insight into the topic.



    Ubuntu Forum discussions
    There are several other threads where the topic of creating a shared directory is discussed. However, the reason I have for creating this thread is to for once and for all solve the issue of files/directories preserving their permissions when being copied into a shared directory (thereby not allowing other users access to these files).

    Last edited by Brucevdk; November 9th, 2008 at 12:25 PM. Reason: 1) Clarification of the title 2) Extended references 3) More detail 4) Layout

  2. #2
    Join Date
    May 2006
    Location
    The Netherlands
    Beans
    395
    Distro
    Ubuntu Development Release

    Re: Problems with sharing a directory amongst multiple users (permissions are preserv

    bump up

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •