How to force specific group permissions (r/w) on files created in a directory structure?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I have a directory set up on a Linux server such that I'd like all files within it to be readable and writeable for a specific group.



So far, I've done chmod g+s mygroup parent, and I can see that all files inherit this group when created within this directory.



However, it does not force the g+rw permission, and so it is possible for a user to write a file into that directory such that others do not have read and/or write access to it.



How can I achieve this?










share|improve this question























  • What is mygroup? Because of its name I expect a group but the syntax of chmod g+s mygroup parent doesn't fit. This obfuscates the question slightly.
    – Kamil Maciorowski
    13 mins ago















up vote
2
down vote

favorite












I have a directory set up on a Linux server such that I'd like all files within it to be readable and writeable for a specific group.



So far, I've done chmod g+s mygroup parent, and I can see that all files inherit this group when created within this directory.



However, it does not force the g+rw permission, and so it is possible for a user to write a file into that directory such that others do not have read and/or write access to it.



How can I achieve this?










share|improve this question























  • What is mygroup? Because of its name I expect a group but the syntax of chmod g+s mygroup parent doesn't fit. This obfuscates the question slightly.
    – Kamil Maciorowski
    13 mins ago













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I have a directory set up on a Linux server such that I'd like all files within it to be readable and writeable for a specific group.



So far, I've done chmod g+s mygroup parent, and I can see that all files inherit this group when created within this directory.



However, it does not force the g+rw permission, and so it is possible for a user to write a file into that directory such that others do not have read and/or write access to it.



How can I achieve this?










share|improve this question















I have a directory set up on a Linux server such that I'd like all files within it to be readable and writeable for a specific group.



So far, I've done chmod g+s mygroup parent, and I can see that all files inherit this group when created within this directory.



However, it does not force the g+rw permission, and so it is possible for a user to write a file into that directory such that others do not have read and/or write access to it.



How can I achieve this?







linux permissions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 hours ago

























asked 5 hours ago









Roxy

1366




1366











  • What is mygroup? Because of its name I expect a group but the syntax of chmod g+s mygroup parent doesn't fit. This obfuscates the question slightly.
    – Kamil Maciorowski
    13 mins ago

















  • What is mygroup? Because of its name I expect a group but the syntax of chmod g+s mygroup parent doesn't fit. This obfuscates the question slightly.
    – Kamil Maciorowski
    13 mins ago
















What is mygroup? Because of its name I expect a group but the syntax of chmod g+s mygroup parent doesn't fit. This obfuscates the question slightly.
– Kamil Maciorowski
13 mins ago





What is mygroup? Because of its name I expect a group but the syntax of chmod g+s mygroup parent doesn't fit. This obfuscates the question slightly.
– Kamil Maciorowski
13 mins ago











1 Answer
1






active

oldest

votes

















up vote
2
down vote













Turns out the answer is to use ACLs to set a default:



setfacl -d -m u::rwX,g::rwX,o::- /path/to/parent





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "3"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1368586%2fhow-to-force-specific-group-permissions-r-w-on-files-created-in-a-directory-st%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    Turns out the answer is to use ACLs to set a default:



    setfacl -d -m u::rwX,g::rwX,o::- /path/to/parent





    share|improve this answer
























      up vote
      2
      down vote













      Turns out the answer is to use ACLs to set a default:



      setfacl -d -m u::rwX,g::rwX,o::- /path/to/parent





      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        Turns out the answer is to use ACLs to set a default:



        setfacl -d -m u::rwX,g::rwX,o::- /path/to/parent





        share|improve this answer












        Turns out the answer is to use ACLs to set a default:



        setfacl -d -m u::rwX,g::rwX,o::- /path/to/parent






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        Roxy

        1366




        1366



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1368586%2fhow-to-force-specific-group-permissions-r-w-on-files-created-in-a-directory-st%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Long meetings (6-7 hours a day): Being “babysat” by supervisor

            What does second last employer means? [closed]

            One-line joke