Why umask 077 does not allow user to execute files/directories?

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








up vote
9
down vote

favorite
2












I'm using umask 077."Other" and "group" do not have any rights, but user can't execute files/directories.
Why umask 077 does not allow user to execute files/directories?







share|improve this question























    up vote
    9
    down vote

    favorite
    2












    I'm using umask 077."Other" and "group" do not have any rights, but user can't execute files/directories.
    Why umask 077 does not allow user to execute files/directories?







    share|improve this question





















      up vote
      9
      down vote

      favorite
      2









      up vote
      9
      down vote

      favorite
      2






      2





      I'm using umask 077."Other" and "group" do not have any rights, but user can't execute files/directories.
      Why umask 077 does not allow user to execute files/directories?







      share|improve this question











      I'm using umask 077."Other" and "group" do not have any rights, but user can't execute files/directories.
      Why umask 077 does not allow user to execute files/directories?









      share|improve this question










      share|improve this question




      share|improve this question









      asked Sep 11 '12 at 22:04









      Just me

      46112




      46112




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          down vote













          When you use a umask of 077 only the user has read, write and execute permissions. The user definitely will be able to open ('execute') directories (see more on why directories have to be executable in my answer here). However, files must always be made executable by entering chmod u+x myfile; they are never automatically executable. Some more useful information on umask is given in this answer:



          • What is "umask" and how does it work?

          The likely possibility for your problems is that you have perhaps entered the value slightly incorrectly, which has resulted in a different umask, or that the value has not been permanently set. If you enter umask 077 in the terminal it will only hold good for that session of the terminal; to make it permanent for your user simply add umask 077 to your ~/.profile. The system default setting for umask is in /etc/login.defs; it used to be in /etc/profile. See also the manpage for pam_umask, which is a pam module that handles the assignment of umask.



          The following examples are from a successful setting of umask 077:



          1) For folder creation: mkdir doc checked with stat doc gave the correct permissions and an 'executable' folder:



          File: `doc'
          Size: 4096 Blocks: 8 IO Block: 4096 directory
          Device: 801h/2049d Inode: 6425268 Links: 2
          Access: (0700/drwx------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
          Access: 2012-09-12 11:33:01.236675420 +0100
          Modify: 2012-09-12 11:33:01.236675420 +0100
          Change: 2012-09-12 11:33:01.236675420 +0100
          Birth: -


          2) For file creation: touch new checked with stat new gave the correct permissions; the file is only made executable when you use chmod +x:



          File: `new'
          Size: 0 Blocks: 0 IO Block: 4096 regular empty file
          Device: 801h/2049d Inode: 6303902 Links: 1
          Access: (0600/-rw-------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
          Access: 2012-09-12 11:34:58.272676270 +0100
          Modify: 2012-09-12 11:34:58.272676270 +0100
          Change: 2012-09-12 11:34:58.272676270 +0100


          A umask of 077 will give the permissions shown, but if you still have problems with permissions after setting umask 077 properly (as discussed further above) we can look into it further.






          share|improve this answer






























            up vote
            3
            down vote













            The umask value will be used to appropriately modify the default fmask for file permissions (base permission 0666) and dmask for directory/folder permissions (base permission 0777).



            The effective fmask and dmask values will be calculated by deducting the umask value (Octal calculations).



            So a umask 0022 would result in fmask to get a value 0644 (i.e. 0666 - 0022) while dmask would be 0755 (i.e. 0777 - 0022).



            The umask 0077 prevent files from being created with any access not only to the world (indicated by the ultimate octal digit) but also your group members (indicated by the penultimate octal digit).



            Reference:



            • umask





            share|improve this answer





















            • the more i read this, the more i'm not understand it. Is there any explanation for newbie guy who only want to do small changes without knowing deep?
              – GusDeCooL
              Feb 29 '16 at 4:15










            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            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%2faskubuntu.com%2fquestions%2f186747%2fwhy-umask-077-does-not-allow-user-to-execute-files-directories%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote













            When you use a umask of 077 only the user has read, write and execute permissions. The user definitely will be able to open ('execute') directories (see more on why directories have to be executable in my answer here). However, files must always be made executable by entering chmod u+x myfile; they are never automatically executable. Some more useful information on umask is given in this answer:



            • What is "umask" and how does it work?

            The likely possibility for your problems is that you have perhaps entered the value slightly incorrectly, which has resulted in a different umask, or that the value has not been permanently set. If you enter umask 077 in the terminal it will only hold good for that session of the terminal; to make it permanent for your user simply add umask 077 to your ~/.profile. The system default setting for umask is in /etc/login.defs; it used to be in /etc/profile. See also the manpage for pam_umask, which is a pam module that handles the assignment of umask.



            The following examples are from a successful setting of umask 077:



            1) For folder creation: mkdir doc checked with stat doc gave the correct permissions and an 'executable' folder:



            File: `doc'
            Size: 4096 Blocks: 8 IO Block: 4096 directory
            Device: 801h/2049d Inode: 6425268 Links: 2
            Access: (0700/drwx------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
            Access: 2012-09-12 11:33:01.236675420 +0100
            Modify: 2012-09-12 11:33:01.236675420 +0100
            Change: 2012-09-12 11:33:01.236675420 +0100
            Birth: -


            2) For file creation: touch new checked with stat new gave the correct permissions; the file is only made executable when you use chmod +x:



            File: `new'
            Size: 0 Blocks: 0 IO Block: 4096 regular empty file
            Device: 801h/2049d Inode: 6303902 Links: 1
            Access: (0600/-rw-------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
            Access: 2012-09-12 11:34:58.272676270 +0100
            Modify: 2012-09-12 11:34:58.272676270 +0100
            Change: 2012-09-12 11:34:58.272676270 +0100


            A umask of 077 will give the permissions shown, but if you still have problems with permissions after setting umask 077 properly (as discussed further above) we can look into it further.






            share|improve this answer



























              up vote
              5
              down vote













              When you use a umask of 077 only the user has read, write and execute permissions. The user definitely will be able to open ('execute') directories (see more on why directories have to be executable in my answer here). However, files must always be made executable by entering chmod u+x myfile; they are never automatically executable. Some more useful information on umask is given in this answer:



              • What is "umask" and how does it work?

              The likely possibility for your problems is that you have perhaps entered the value slightly incorrectly, which has resulted in a different umask, or that the value has not been permanently set. If you enter umask 077 in the terminal it will only hold good for that session of the terminal; to make it permanent for your user simply add umask 077 to your ~/.profile. The system default setting for umask is in /etc/login.defs; it used to be in /etc/profile. See also the manpage for pam_umask, which is a pam module that handles the assignment of umask.



              The following examples are from a successful setting of umask 077:



              1) For folder creation: mkdir doc checked with stat doc gave the correct permissions and an 'executable' folder:



              File: `doc'
              Size: 4096 Blocks: 8 IO Block: 4096 directory
              Device: 801h/2049d Inode: 6425268 Links: 2
              Access: (0700/drwx------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
              Access: 2012-09-12 11:33:01.236675420 +0100
              Modify: 2012-09-12 11:33:01.236675420 +0100
              Change: 2012-09-12 11:33:01.236675420 +0100
              Birth: -


              2) For file creation: touch new checked with stat new gave the correct permissions; the file is only made executable when you use chmod +x:



              File: `new'
              Size: 0 Blocks: 0 IO Block: 4096 regular empty file
              Device: 801h/2049d Inode: 6303902 Links: 1
              Access: (0600/-rw-------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
              Access: 2012-09-12 11:34:58.272676270 +0100
              Modify: 2012-09-12 11:34:58.272676270 +0100
              Change: 2012-09-12 11:34:58.272676270 +0100


              A umask of 077 will give the permissions shown, but if you still have problems with permissions after setting umask 077 properly (as discussed further above) we can look into it further.






              share|improve this answer

























                up vote
                5
                down vote










                up vote
                5
                down vote









                When you use a umask of 077 only the user has read, write and execute permissions. The user definitely will be able to open ('execute') directories (see more on why directories have to be executable in my answer here). However, files must always be made executable by entering chmod u+x myfile; they are never automatically executable. Some more useful information on umask is given in this answer:



                • What is "umask" and how does it work?

                The likely possibility for your problems is that you have perhaps entered the value slightly incorrectly, which has resulted in a different umask, or that the value has not been permanently set. If you enter umask 077 in the terminal it will only hold good for that session of the terminal; to make it permanent for your user simply add umask 077 to your ~/.profile. The system default setting for umask is in /etc/login.defs; it used to be in /etc/profile. See also the manpage for pam_umask, which is a pam module that handles the assignment of umask.



                The following examples are from a successful setting of umask 077:



                1) For folder creation: mkdir doc checked with stat doc gave the correct permissions and an 'executable' folder:



                File: `doc'
                Size: 4096 Blocks: 8 IO Block: 4096 directory
                Device: 801h/2049d Inode: 6425268 Links: 2
                Access: (0700/drwx------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
                Access: 2012-09-12 11:33:01.236675420 +0100
                Modify: 2012-09-12 11:33:01.236675420 +0100
                Change: 2012-09-12 11:33:01.236675420 +0100
                Birth: -


                2) For file creation: touch new checked with stat new gave the correct permissions; the file is only made executable when you use chmod +x:



                File: `new'
                Size: 0 Blocks: 0 IO Block: 4096 regular empty file
                Device: 801h/2049d Inode: 6303902 Links: 1
                Access: (0600/-rw-------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
                Access: 2012-09-12 11:34:58.272676270 +0100
                Modify: 2012-09-12 11:34:58.272676270 +0100
                Change: 2012-09-12 11:34:58.272676270 +0100


                A umask of 077 will give the permissions shown, but if you still have problems with permissions after setting umask 077 properly (as discussed further above) we can look into it further.






                share|improve this answer















                When you use a umask of 077 only the user has read, write and execute permissions. The user definitely will be able to open ('execute') directories (see more on why directories have to be executable in my answer here). However, files must always be made executable by entering chmod u+x myfile; they are never automatically executable. Some more useful information on umask is given in this answer:



                • What is "umask" and how does it work?

                The likely possibility for your problems is that you have perhaps entered the value slightly incorrectly, which has resulted in a different umask, or that the value has not been permanently set. If you enter umask 077 in the terminal it will only hold good for that session of the terminal; to make it permanent for your user simply add umask 077 to your ~/.profile. The system default setting for umask is in /etc/login.defs; it used to be in /etc/profile. See also the manpage for pam_umask, which is a pam module that handles the assignment of umask.



                The following examples are from a successful setting of umask 077:



                1) For folder creation: mkdir doc checked with stat doc gave the correct permissions and an 'executable' folder:



                File: `doc'
                Size: 4096 Blocks: 8 IO Block: 4096 directory
                Device: 801h/2049d Inode: 6425268 Links: 2
                Access: (0700/drwx------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
                Access: 2012-09-12 11:33:01.236675420 +0100
                Modify: 2012-09-12 11:33:01.236675420 +0100
                Change: 2012-09-12 11:33:01.236675420 +0100
                Birth: -


                2) For file creation: touch new checked with stat new gave the correct permissions; the file is only made executable when you use chmod +x:



                File: `new'
                Size: 0 Blocks: 0 IO Block: 4096 regular empty file
                Device: 801h/2049d Inode: 6303902 Links: 1
                Access: (0600/-rw-------) Uid: ( 1000/ mike) Gid: ( 1000/ mike)
                Access: 2012-09-12 11:34:58.272676270 +0100
                Modify: 2012-09-12 11:34:58.272676270 +0100
                Change: 2012-09-12 11:34:58.272676270 +0100


                A umask of 077 will give the permissions shown, but if you still have problems with permissions after setting umask 077 properly (as discussed further above) we can look into it further.







                share|improve this answer















                share|improve this answer



                share|improve this answer








                edited Apr 13 '17 at 12:23









                Community♦

                1




                1











                answered Sep 12 '12 at 11:07







                user76204





























                    up vote
                    3
                    down vote













                    The umask value will be used to appropriately modify the default fmask for file permissions (base permission 0666) and dmask for directory/folder permissions (base permission 0777).



                    The effective fmask and dmask values will be calculated by deducting the umask value (Octal calculations).



                    So a umask 0022 would result in fmask to get a value 0644 (i.e. 0666 - 0022) while dmask would be 0755 (i.e. 0777 - 0022).



                    The umask 0077 prevent files from being created with any access not only to the world (indicated by the ultimate octal digit) but also your group members (indicated by the penultimate octal digit).



                    Reference:



                    • umask





                    share|improve this answer





















                    • the more i read this, the more i'm not understand it. Is there any explanation for newbie guy who only want to do small changes without knowing deep?
                      – GusDeCooL
                      Feb 29 '16 at 4:15














                    up vote
                    3
                    down vote













                    The umask value will be used to appropriately modify the default fmask for file permissions (base permission 0666) and dmask for directory/folder permissions (base permission 0777).



                    The effective fmask and dmask values will be calculated by deducting the umask value (Octal calculations).



                    So a umask 0022 would result in fmask to get a value 0644 (i.e. 0666 - 0022) while dmask would be 0755 (i.e. 0777 - 0022).



                    The umask 0077 prevent files from being created with any access not only to the world (indicated by the ultimate octal digit) but also your group members (indicated by the penultimate octal digit).



                    Reference:



                    • umask





                    share|improve this answer





















                    • the more i read this, the more i'm not understand it. Is there any explanation for newbie guy who only want to do small changes without knowing deep?
                      – GusDeCooL
                      Feb 29 '16 at 4:15












                    up vote
                    3
                    down vote










                    up vote
                    3
                    down vote









                    The umask value will be used to appropriately modify the default fmask for file permissions (base permission 0666) and dmask for directory/folder permissions (base permission 0777).



                    The effective fmask and dmask values will be calculated by deducting the umask value (Octal calculations).



                    So a umask 0022 would result in fmask to get a value 0644 (i.e. 0666 - 0022) while dmask would be 0755 (i.e. 0777 - 0022).



                    The umask 0077 prevent files from being created with any access not only to the world (indicated by the ultimate octal digit) but also your group members (indicated by the penultimate octal digit).



                    Reference:



                    • umask





                    share|improve this answer













                    The umask value will be used to appropriately modify the default fmask for file permissions (base permission 0666) and dmask for directory/folder permissions (base permission 0777).



                    The effective fmask and dmask values will be calculated by deducting the umask value (Octal calculations).



                    So a umask 0022 would result in fmask to get a value 0644 (i.e. 0666 - 0022) while dmask would be 0755 (i.e. 0777 - 0022).



                    The umask 0077 prevent files from being created with any access not only to the world (indicated by the ultimate octal digit) but also your group members (indicated by the penultimate octal digit).



                    Reference:



                    • umask






                    share|improve this answer













                    share|improve this answer



                    share|improve this answer











                    answered Mar 2 '14 at 12:28









                    precise

                    10.2k54778




                    10.2k54778











                    • the more i read this, the more i'm not understand it. Is there any explanation for newbie guy who only want to do small changes without knowing deep?
                      – GusDeCooL
                      Feb 29 '16 at 4:15
















                    • the more i read this, the more i'm not understand it. Is there any explanation for newbie guy who only want to do small changes without knowing deep?
                      – GusDeCooL
                      Feb 29 '16 at 4:15















                    the more i read this, the more i'm not understand it. Is there any explanation for newbie guy who only want to do small changes without knowing deep?
                    – GusDeCooL
                    Feb 29 '16 at 4:15




                    the more i read this, the more i'm not understand it. Is there any explanation for newbie guy who only want to do small changes without knowing deep?
                    – GusDeCooL
                    Feb 29 '16 at 4:15












                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f186747%2fwhy-umask-077-does-not-allow-user-to-execute-files-directories%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    pylint3 and pip3 broken

                    Missing snmpget and snmpwalk

                    How to enroll fingerprints to Ubuntu 17.10 with VFS491