Setting a default umask permanently

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











up vote
0
down vote

favorite












If we create a shared directory, and allow say a root user and a group sharedgroup to the permissions: -rwxrwxr--, and we want every new file to have the permissions -rwxrwxr--, but the permission of the parent directory to be rwxrwxr-w. The way to do this would(what I know) be to set the default umask to 0003, but it appears once we close the terminal the umask is reset. So how do we make the change permanent only for a directory, because we wouldn't want to change the umasks of the entire system.










share|improve this question





















  • How are users accessing this directory? SSH into hte machine? or via a network share?
    – ivanivan
    Sep 26 '17 at 2:10










  • It's basically a machine, that multiple users will be logged in, like a cyber cafe where the users are given a seperate account
    – mathmaniage
    Sep 26 '17 at 4:57










  • r-w for a directory makes little sense. You can't write to a directory if you don't have search permission as you need search permissions to anything with files in the directory. Giving execute permission to every non-directory file also makes little sense. Only files meant to be executed should have that permission.
    – Stéphane Chazelas
    Sep 26 '17 at 7:09














up vote
0
down vote

favorite












If we create a shared directory, and allow say a root user and a group sharedgroup to the permissions: -rwxrwxr--, and we want every new file to have the permissions -rwxrwxr--, but the permission of the parent directory to be rwxrwxr-w. The way to do this would(what I know) be to set the default umask to 0003, but it appears once we close the terminal the umask is reset. So how do we make the change permanent only for a directory, because we wouldn't want to change the umasks of the entire system.










share|improve this question





















  • How are users accessing this directory? SSH into hte machine? or via a network share?
    – ivanivan
    Sep 26 '17 at 2:10










  • It's basically a machine, that multiple users will be logged in, like a cyber cafe where the users are given a seperate account
    – mathmaniage
    Sep 26 '17 at 4:57










  • r-w for a directory makes little sense. You can't write to a directory if you don't have search permission as you need search permissions to anything with files in the directory. Giving execute permission to every non-directory file also makes little sense. Only files meant to be executed should have that permission.
    – Stéphane Chazelas
    Sep 26 '17 at 7:09












up vote
0
down vote

favorite









up vote
0
down vote

favorite











If we create a shared directory, and allow say a root user and a group sharedgroup to the permissions: -rwxrwxr--, and we want every new file to have the permissions -rwxrwxr--, but the permission of the parent directory to be rwxrwxr-w. The way to do this would(what I know) be to set the default umask to 0003, but it appears once we close the terminal the umask is reset. So how do we make the change permanent only for a directory, because we wouldn't want to change the umasks of the entire system.










share|improve this question













If we create a shared directory, and allow say a root user and a group sharedgroup to the permissions: -rwxrwxr--, and we want every new file to have the permissions -rwxrwxr--, but the permission of the parent directory to be rwxrwxr-w. The way to do this would(what I know) be to set the default umask to 0003, but it appears once we close the terminal the umask is reset. So how do we make the change permanent only for a directory, because we wouldn't want to change the umasks of the entire system.







ubuntu permissions






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 26 '17 at 1:50









mathmaniage

183




183











  • How are users accessing this directory? SSH into hte machine? or via a network share?
    – ivanivan
    Sep 26 '17 at 2:10










  • It's basically a machine, that multiple users will be logged in, like a cyber cafe where the users are given a seperate account
    – mathmaniage
    Sep 26 '17 at 4:57










  • r-w for a directory makes little sense. You can't write to a directory if you don't have search permission as you need search permissions to anything with files in the directory. Giving execute permission to every non-directory file also makes little sense. Only files meant to be executed should have that permission.
    – Stéphane Chazelas
    Sep 26 '17 at 7:09
















  • How are users accessing this directory? SSH into hte machine? or via a network share?
    – ivanivan
    Sep 26 '17 at 2:10










  • It's basically a machine, that multiple users will be logged in, like a cyber cafe where the users are given a seperate account
    – mathmaniage
    Sep 26 '17 at 4:57










  • r-w for a directory makes little sense. You can't write to a directory if you don't have search permission as you need search permissions to anything with files in the directory. Giving execute permission to every non-directory file also makes little sense. Only files meant to be executed should have that permission.
    – Stéphane Chazelas
    Sep 26 '17 at 7:09















How are users accessing this directory? SSH into hte machine? or via a network share?
– ivanivan
Sep 26 '17 at 2:10




How are users accessing this directory? SSH into hte machine? or via a network share?
– ivanivan
Sep 26 '17 at 2:10












It's basically a machine, that multiple users will be logged in, like a cyber cafe where the users are given a seperate account
– mathmaniage
Sep 26 '17 at 4:57




It's basically a machine, that multiple users will be logged in, like a cyber cafe where the users are given a seperate account
– mathmaniage
Sep 26 '17 at 4:57












r-w for a directory makes little sense. You can't write to a directory if you don't have search permission as you need search permissions to anything with files in the directory. Giving execute permission to every non-directory file also makes little sense. Only files meant to be executed should have that permission.
– Stéphane Chazelas
Sep 26 '17 at 7:09




r-w for a directory makes little sense. You can't write to a directory if you don't have search permission as you need search permissions to anything with files in the directory. Giving execute permission to every non-directory file also makes little sense. Only files meant to be executed should have that permission.
– Stéphane Chazelas
Sep 26 '17 at 7:09










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










You cannot customize umask on a per-directory basis.



The typical way to solve your particular scenario, is to use a setfacl default mask.






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f394443%2fsetting-a-default-umask-permanently%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
    0
    down vote



    accepted










    You cannot customize umask on a per-directory basis.



    The typical way to solve your particular scenario, is to use a setfacl default mask.






    share|improve this answer


























      up vote
      0
      down vote



      accepted










      You cannot customize umask on a per-directory basis.



      The typical way to solve your particular scenario, is to use a setfacl default mask.






      share|improve this answer
























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        You cannot customize umask on a per-directory basis.



        The typical way to solve your particular scenario, is to use a setfacl default mask.






        share|improve this answer














        You cannot customize umask on a per-directory basis.



        The typical way to solve your particular scenario, is to use a setfacl default mask.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 26 '17 at 6:44

























        answered Sep 26 '17 at 6:37









        fpmurphy1

        2,231915




        2,231915



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394443%2fsetting-a-default-umask-permanently%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?