File create permission error although dir has 777 permission












0














On running command touch file
I am getting error



touch: cannot touch 'file': permission denied


Although I have 777 permissions on the dir where I am trying to create file but still not able to create file with one particular user, some other users can create files there.



Tried strace to see what might be root cause but not able to to understand strace output.
One line and I guess relevant as well of strace output is:



open("file", O_WRONGLY|O_CREATE|O_NOCTTY|O_NONBLOCK, 0666) = -1  EACESS (Permission denied)


I tried to create file with specific permissions as well but getting permission error, command tried is:



install -b -m 511 /dev/null file









share|improve this question
























  • Is the user that cannot create a file in the directory able to navigate (i.e., cd) to that directory?
    – Andy Dalton
    Oct 7 '17 at 5:26










  • @AndyDalton yes
    – Vipin
    Oct 7 '17 at 5:31










  • Does a file with that name already exist, and if so is it owned by a different user?
    – Andy Dalton
    Oct 7 '17 at 5:34










  • Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
    – user3411123
    Oct 7 '17 at 5:39






  • 1




    @user3411123 the question you gave looks like completely different to me
    – Vipin
    Oct 7 '17 at 5:47
















0














On running command touch file
I am getting error



touch: cannot touch 'file': permission denied


Although I have 777 permissions on the dir where I am trying to create file but still not able to create file with one particular user, some other users can create files there.



Tried strace to see what might be root cause but not able to to understand strace output.
One line and I guess relevant as well of strace output is:



open("file", O_WRONGLY|O_CREATE|O_NOCTTY|O_NONBLOCK, 0666) = -1  EACESS (Permission denied)


I tried to create file with specific permissions as well but getting permission error, command tried is:



install -b -m 511 /dev/null file









share|improve this question
























  • Is the user that cannot create a file in the directory able to navigate (i.e., cd) to that directory?
    – Andy Dalton
    Oct 7 '17 at 5:26










  • @AndyDalton yes
    – Vipin
    Oct 7 '17 at 5:31










  • Does a file with that name already exist, and if so is it owned by a different user?
    – Andy Dalton
    Oct 7 '17 at 5:34










  • Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
    – user3411123
    Oct 7 '17 at 5:39






  • 1




    @user3411123 the question you gave looks like completely different to me
    – Vipin
    Oct 7 '17 at 5:47














0












0








0







On running command touch file
I am getting error



touch: cannot touch 'file': permission denied


Although I have 777 permissions on the dir where I am trying to create file but still not able to create file with one particular user, some other users can create files there.



Tried strace to see what might be root cause but not able to to understand strace output.
One line and I guess relevant as well of strace output is:



open("file", O_WRONGLY|O_CREATE|O_NOCTTY|O_NONBLOCK, 0666) = -1  EACESS (Permission denied)


I tried to create file with specific permissions as well but getting permission error, command tried is:



install -b -m 511 /dev/null file









share|improve this question















On running command touch file
I am getting error



touch: cannot touch 'file': permission denied


Although I have 777 permissions on the dir where I am trying to create file but still not able to create file with one particular user, some other users can create files there.



Tried strace to see what might be root cause but not able to to understand strace output.
One line and I guess relevant as well of strace output is:



open("file", O_WRONGLY|O_CREATE|O_NOCTTY|O_NONBLOCK, 0666) = -1  EACESS (Permission denied)


I tried to create file with specific permissions as well but getting permission error, command tried is:



install -b -m 511 /dev/null file






linux files permissions filesystems strace






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 6:11









RalfFriedl

5,3033925




5,3033925










asked Oct 7 '17 at 4:47









Vipin

1013




1013












  • Is the user that cannot create a file in the directory able to navigate (i.e., cd) to that directory?
    – Andy Dalton
    Oct 7 '17 at 5:26










  • @AndyDalton yes
    – Vipin
    Oct 7 '17 at 5:31










  • Does a file with that name already exist, and if so is it owned by a different user?
    – Andy Dalton
    Oct 7 '17 at 5:34










  • Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
    – user3411123
    Oct 7 '17 at 5:39






  • 1




    @user3411123 the question you gave looks like completely different to me
    – Vipin
    Oct 7 '17 at 5:47


















  • Is the user that cannot create a file in the directory able to navigate (i.e., cd) to that directory?
    – Andy Dalton
    Oct 7 '17 at 5:26










  • @AndyDalton yes
    – Vipin
    Oct 7 '17 at 5:31










  • Does a file with that name already exist, and if so is it owned by a different user?
    – Andy Dalton
    Oct 7 '17 at 5:34










  • Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
    – user3411123
    Oct 7 '17 at 5:39






  • 1




    @user3411123 the question you gave looks like completely different to me
    – Vipin
    Oct 7 '17 at 5:47
















Is the user that cannot create a file in the directory able to navigate (i.e., cd) to that directory?
– Andy Dalton
Oct 7 '17 at 5:26




Is the user that cannot create a file in the directory able to navigate (i.e., cd) to that directory?
– Andy Dalton
Oct 7 '17 at 5:26












@AndyDalton yes
– Vipin
Oct 7 '17 at 5:31




@AndyDalton yes
– Vipin
Oct 7 '17 at 5:31












Does a file with that name already exist, and if so is it owned by a different user?
– Andy Dalton
Oct 7 '17 at 5:34




Does a file with that name already exist, and if so is it owned by a different user?
– Andy Dalton
Oct 7 '17 at 5:34












Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
– user3411123
Oct 7 '17 at 5:39




Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
– user3411123
Oct 7 '17 at 5:39




1




1




@user3411123 the question you gave looks like completely different to me
– Vipin
Oct 7 '17 at 5:47




@user3411123 the question you gave looks like completely different to me
– Vipin
Oct 7 '17 at 5:47










2 Answers
2






active

oldest

votes


















0














Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl.



Get current ACL - You can check permissions for any file or directory with getfacl. See example below.



# getfacl dir/
file: dir
owner: root
group: root
user::rwx
group::---
other::---



Set permissions with ACL -
You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory






share|improve this answer





























    -1














    Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .



    Please see that once , if there are some permission problems from Root directory to your current directory .



    One Other reason may be , check selinux is enabled or not .






    share|improve this answer

















    • 2




      Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
      – Vipin
      Oct 7 '17 at 6:01










    • If the OP can get to the directory in question, parent permissions have no more relevance.
      – roaima
      Nov 12 at 7:52











    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    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%2f396619%2ffile-create-permission-error-although-dir-has-777-permission%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl.



    Get current ACL - You can check permissions for any file or directory with getfacl. See example below.



    # getfacl dir/
    file: dir
    owner: root
    group: root
    user::rwx
    group::---
    other::---



    Set permissions with ACL -
    You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory






    share|improve this answer


























      0














      Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl.



      Get current ACL - You can check permissions for any file or directory with getfacl. See example below.



      # getfacl dir/
      file: dir
      owner: root
      group: root
      user::rwx
      group::---
      other::---



      Set permissions with ACL -
      You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory






      share|improve this answer
























        0












        0








        0






        Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl.



        Get current ACL - You can check permissions for any file or directory with getfacl. See example below.



        # getfacl dir/
        file: dir
        owner: root
        group: root
        user::rwx
        group::---
        other::---



        Set permissions with ACL -
        You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory






        share|improve this answer












        Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl.



        Get current ACL - You can check permissions for any file or directory with getfacl. See example below.



        # getfacl dir/
        file: dir
        owner: root
        group: root
        user::rwx
        group::---
        other::---



        Set permissions with ACL -
        You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 8 '17 at 13:09









        William Sandin

        29115




        29115

























            -1














            Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .



            Please see that once , if there are some permission problems from Root directory to your current directory .



            One Other reason may be , check selinux is enabled or not .






            share|improve this answer

















            • 2




              Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
              – Vipin
              Oct 7 '17 at 6:01










            • If the OP can get to the directory in question, parent permissions have no more relevance.
              – roaima
              Nov 12 at 7:52
















            -1














            Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .



            Please see that once , if there are some permission problems from Root directory to your current directory .



            One Other reason may be , check selinux is enabled or not .






            share|improve this answer

















            • 2




              Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
              – Vipin
              Oct 7 '17 at 6:01










            • If the OP can get to the directory in question, parent permissions have no more relevance.
              – roaima
              Nov 12 at 7:52














            -1












            -1








            -1






            Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .



            Please see that once , if there are some permission problems from Root directory to your current directory .



            One Other reason may be , check selinux is enabled or not .






            share|improve this answer












            Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .



            Please see that once , if there are some permission problems from Root directory to your current directory .



            One Other reason may be , check selinux is enabled or not .







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 7 '17 at 5:50









            Sahil Aggarwal

            992




            992








            • 2




              Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
              – Vipin
              Oct 7 '17 at 6:01










            • If the OP can get to the directory in question, parent permissions have no more relevance.
              – roaima
              Nov 12 at 7:52














            • 2




              Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
              – Vipin
              Oct 7 '17 at 6:01










            • If the OP can get to the directory in question, parent permissions have no more relevance.
              – roaima
              Nov 12 at 7:52








            2




            2




            Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
            – Vipin
            Oct 7 '17 at 6:01




            Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
            – Vipin
            Oct 7 '17 at 6:01












            If the OP can get to the directory in question, parent permissions have no more relevance.
            – roaima
            Nov 12 at 7:52




            If the OP can get to the directory in question, parent permissions have no more relevance.
            – roaima
            Nov 12 at 7:52


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f396619%2ffile-create-permission-error-although-dir-has-777-permission%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre