Unable to access group files even though user is part of the group

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












0















I am trying to access a directory test as user ayush.
This directory is owned by user ayush and has group git
The directory has permissions 0070, and group git, and ayush is a member of that group.



ayush:~> ls -ld
drwxr-xr-x 7 ayush git 4096 Feb 15 11:33 .
ayush:~> ls
test
ayush:~> ls -ld test/
drwxrwx--- 3 ayush git 4096 Feb 15 11:34 test/
ayush:~> chmod 070 test/
ayush:~> ls -ld test/
d---rwx--- 3 ayush git 4096 Feb 15 11:34 test/
ayush:~> ls -l test/
ls: cannot open directory test/: Permission denied
ayush:~> groups
git
ayush:~> id
uid=11417(ayush) gid=30(git) groups=30(git)


I have been seeing this error for a while now and it was not there before.
This is not a new group and I have using it in some of my code here and there.



BTW, I switched to another user who is also part of this group who was able to access "test" directory without any issues.



EDIT 1: Its not just this, I am unable to change the group of the folder "test" with 770 permissions. I am getting an "operation not permitted" error. And, I am facing this issue with only the group "git". I am able to switch the group of the folder to another group of which I am a member of. But then I am not able to switch back the user to "git".










share|improve this question
























  • I don't really understand what you're doing in your EDIT 1 text. Could you show with examples?

    – Kusalananda
    Feb 16 at 19:37















0















I am trying to access a directory test as user ayush.
This directory is owned by user ayush and has group git
The directory has permissions 0070, and group git, and ayush is a member of that group.



ayush:~> ls -ld
drwxr-xr-x 7 ayush git 4096 Feb 15 11:33 .
ayush:~> ls
test
ayush:~> ls -ld test/
drwxrwx--- 3 ayush git 4096 Feb 15 11:34 test/
ayush:~> chmod 070 test/
ayush:~> ls -ld test/
d---rwx--- 3 ayush git 4096 Feb 15 11:34 test/
ayush:~> ls -l test/
ls: cannot open directory test/: Permission denied
ayush:~> groups
git
ayush:~> id
uid=11417(ayush) gid=30(git) groups=30(git)


I have been seeing this error for a while now and it was not there before.
This is not a new group and I have using it in some of my code here and there.



BTW, I switched to another user who is also part of this group who was able to access "test" directory without any issues.



EDIT 1: Its not just this, I am unable to change the group of the folder "test" with 770 permissions. I am getting an "operation not permitted" error. And, I am facing this issue with only the group "git". I am able to switch the group of the folder to another group of which I am a member of. But then I am not able to switch back the user to "git".










share|improve this question
























  • I don't really understand what you're doing in your EDIT 1 text. Could you show with examples?

    – Kusalananda
    Feb 16 at 19:37













0












0








0








I am trying to access a directory test as user ayush.
This directory is owned by user ayush and has group git
The directory has permissions 0070, and group git, and ayush is a member of that group.



ayush:~> ls -ld
drwxr-xr-x 7 ayush git 4096 Feb 15 11:33 .
ayush:~> ls
test
ayush:~> ls -ld test/
drwxrwx--- 3 ayush git 4096 Feb 15 11:34 test/
ayush:~> chmod 070 test/
ayush:~> ls -ld test/
d---rwx--- 3 ayush git 4096 Feb 15 11:34 test/
ayush:~> ls -l test/
ls: cannot open directory test/: Permission denied
ayush:~> groups
git
ayush:~> id
uid=11417(ayush) gid=30(git) groups=30(git)


I have been seeing this error for a while now and it was not there before.
This is not a new group and I have using it in some of my code here and there.



BTW, I switched to another user who is also part of this group who was able to access "test" directory without any issues.



EDIT 1: Its not just this, I am unable to change the group of the folder "test" with 770 permissions. I am getting an "operation not permitted" error. And, I am facing this issue with only the group "git". I am able to switch the group of the folder to another group of which I am a member of. But then I am not able to switch back the user to "git".










share|improve this question
















I am trying to access a directory test as user ayush.
This directory is owned by user ayush and has group git
The directory has permissions 0070, and group git, and ayush is a member of that group.



ayush:~> ls -ld
drwxr-xr-x 7 ayush git 4096 Feb 15 11:33 .
ayush:~> ls
test
ayush:~> ls -ld test/
drwxrwx--- 3 ayush git 4096 Feb 15 11:34 test/
ayush:~> chmod 070 test/
ayush:~> ls -ld test/
d---rwx--- 3 ayush git 4096 Feb 15 11:34 test/
ayush:~> ls -l test/
ls: cannot open directory test/: Permission denied
ayush:~> groups
git
ayush:~> id
uid=11417(ayush) gid=30(git) groups=30(git)


I have been seeing this error for a while now and it was not there before.
This is not a new group and I have using it in some of my code here and there.



BTW, I switched to another user who is also part of this group who was able to access "test" directory without any issues.



EDIT 1: Its not just this, I am unable to change the group of the folder "test" with 770 permissions. I am getting an "operation not permitted" error. And, I am facing this issue with only the group "git". I am able to switch the group of the folder to another group of which I am a member of. But then I am not able to switch back the user to "git".







linux permissions users group






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 17 at 5:29







Ayu

















asked Feb 16 at 13:35









AyuAyu

12




12












  • I don't really understand what you're doing in your EDIT 1 text. Could you show with examples?

    – Kusalananda
    Feb 16 at 19:37

















  • I don't really understand what you're doing in your EDIT 1 text. Could you show with examples?

    – Kusalananda
    Feb 16 at 19:37
















I don't really understand what you're doing in your EDIT 1 text. Could you show with examples?

– Kusalananda
Feb 16 at 19:37





I don't really understand what you're doing in your EDIT 1 text. Could you show with examples?

– Kusalananda
Feb 16 at 19:37










2 Answers
2






active

oldest

votes


















3














Since you're the owner of the file, "user" permissions apply.



Group permissions only apply if you're not the owner.



Similarly, "other" permissions only apply if you're not the owner and not in the group.



The one difference is the root user, who can read files even if permissions say otherwise :-)






share|improve this answer























  • The exception is any process with capability CAP_DAC_OVERRIDE, by default root has all capabilities.

    – ctrl-alt-delor
    Feb 16 at 16:00











  • Hi. I have edited the question and added the last line. Can you please check that out as well? Thanks.

    – Ayu
    Feb 16 at 19:00


















0














I found the issue. I have a cap of 16 groups and I had added my user to 17 groups. The "git" group was listed as the last and hence I wasn't counted as a member of it when doing group operations as only the first 16 groups were considered.






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',
    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%2f501045%2funable-to-access-group-files-even-though-user-is-part-of-the-group%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









    3














    Since you're the owner of the file, "user" permissions apply.



    Group permissions only apply if you're not the owner.



    Similarly, "other" permissions only apply if you're not the owner and not in the group.



    The one difference is the root user, who can read files even if permissions say otherwise :-)






    share|improve this answer























    • The exception is any process with capability CAP_DAC_OVERRIDE, by default root has all capabilities.

      – ctrl-alt-delor
      Feb 16 at 16:00











    • Hi. I have edited the question and added the last line. Can you please check that out as well? Thanks.

      – Ayu
      Feb 16 at 19:00















    3














    Since you're the owner of the file, "user" permissions apply.



    Group permissions only apply if you're not the owner.



    Similarly, "other" permissions only apply if you're not the owner and not in the group.



    The one difference is the root user, who can read files even if permissions say otherwise :-)






    share|improve this answer























    • The exception is any process with capability CAP_DAC_OVERRIDE, by default root has all capabilities.

      – ctrl-alt-delor
      Feb 16 at 16:00











    • Hi. I have edited the question and added the last line. Can you please check that out as well? Thanks.

      – Ayu
      Feb 16 at 19:00













    3












    3








    3







    Since you're the owner of the file, "user" permissions apply.



    Group permissions only apply if you're not the owner.



    Similarly, "other" permissions only apply if you're not the owner and not in the group.



    The one difference is the root user, who can read files even if permissions say otherwise :-)






    share|improve this answer













    Since you're the owner of the file, "user" permissions apply.



    Group permissions only apply if you're not the owner.



    Similarly, "other" permissions only apply if you're not the owner and not in the group.



    The one difference is the root user, who can read files even if permissions say otherwise :-)







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 16 at 13:48









    Stephen HarrisStephen Harris

    26.5k34780




    26.5k34780












    • The exception is any process with capability CAP_DAC_OVERRIDE, by default root has all capabilities.

      – ctrl-alt-delor
      Feb 16 at 16:00











    • Hi. I have edited the question and added the last line. Can you please check that out as well? Thanks.

      – Ayu
      Feb 16 at 19:00

















    • The exception is any process with capability CAP_DAC_OVERRIDE, by default root has all capabilities.

      – ctrl-alt-delor
      Feb 16 at 16:00











    • Hi. I have edited the question and added the last line. Can you please check that out as well? Thanks.

      – Ayu
      Feb 16 at 19:00
















    The exception is any process with capability CAP_DAC_OVERRIDE, by default root has all capabilities.

    – ctrl-alt-delor
    Feb 16 at 16:00





    The exception is any process with capability CAP_DAC_OVERRIDE, by default root has all capabilities.

    – ctrl-alt-delor
    Feb 16 at 16:00













    Hi. I have edited the question and added the last line. Can you please check that out as well? Thanks.

    – Ayu
    Feb 16 at 19:00





    Hi. I have edited the question and added the last line. Can you please check that out as well? Thanks.

    – Ayu
    Feb 16 at 19:00













    0














    I found the issue. I have a cap of 16 groups and I had added my user to 17 groups. The "git" group was listed as the last and hence I wasn't counted as a member of it when doing group operations as only the first 16 groups were considered.






    share|improve this answer



























      0














      I found the issue. I have a cap of 16 groups and I had added my user to 17 groups. The "git" group was listed as the last and hence I wasn't counted as a member of it when doing group operations as only the first 16 groups were considered.






      share|improve this answer

























        0












        0








        0







        I found the issue. I have a cap of 16 groups and I had added my user to 17 groups. The "git" group was listed as the last and hence I wasn't counted as a member of it when doing group operations as only the first 16 groups were considered.






        share|improve this answer













        I found the issue. I have a cap of 16 groups and I had added my user to 17 groups. The "git" group was listed as the last and hence I wasn't counted as a member of it when doing group operations as only the first 16 groups were considered.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 18 at 8:56









        AyuAyu

        12




        12



























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f501045%2funable-to-access-group-files-even-though-user-is-part-of-the-group%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

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)