why can't i have permission in that group which i already in?












4














I am already a member of the group "aid_sdcard_rw":



android@localhost:~$ whoami
android
android@localhost:~$ groups
android aid_radio ...... aid_sdcard_rw ......


you can see that i am already in group aid_sdcard_rw. Then, when i
access directory /storage/sdcard0 :



android@localhost:~$ ls /storage/sdcard0/
ls: cannot open directory '/storage/sdcard0/': Permission denied


but:



android@localhost:~$ ls -l /storage/
total 8
d---rwxr-x 17 android aid_sdcard_rw 8192 1月 1 1970 sdcard0


doesn't group "aid_sdcard_rw" members have read permission?
why is this Permission denied happened?





The system i run is an ubuntu 16.04 and running in my android phone using
an app called Linux Deploy, and my phone have external sd card inserted :



Welcome to Ubuntu 16.04 LTS (GNU/Linux 3.4.5 armv7l)

* Documentation: https://help.ubuntu.com/
Ubuntu 16.04 LTS [running via Linux Deploy]


The directory /storage/sdcard0 is my external sd card mount directory(see the last line below):



android@localhost:~$ cat /etc/mtab
/dev/loop1 / ext4 rw,relatime,data=ordered 0 0
proc /proc proc rw,relatime 0 0
sys /sys sysfs rw,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/block/vold/179:97 /storage/sdcard0 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0


I have tried umount /storage/sdcard0 and remount it with option -o umask=0000 , but command ls -l /storage get same result as above.










share|improve this question









New contributor




zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    4














    I am already a member of the group "aid_sdcard_rw":



    android@localhost:~$ whoami
    android
    android@localhost:~$ groups
    android aid_radio ...... aid_sdcard_rw ......


    you can see that i am already in group aid_sdcard_rw. Then, when i
    access directory /storage/sdcard0 :



    android@localhost:~$ ls /storage/sdcard0/
    ls: cannot open directory '/storage/sdcard0/': Permission denied


    but:



    android@localhost:~$ ls -l /storage/
    total 8
    d---rwxr-x 17 android aid_sdcard_rw 8192 1月 1 1970 sdcard0


    doesn't group "aid_sdcard_rw" members have read permission?
    why is this Permission denied happened?





    The system i run is an ubuntu 16.04 and running in my android phone using
    an app called Linux Deploy, and my phone have external sd card inserted :



    Welcome to Ubuntu 16.04 LTS (GNU/Linux 3.4.5 armv7l)

    * Documentation: https://help.ubuntu.com/
    Ubuntu 16.04 LTS [running via Linux Deploy]


    The directory /storage/sdcard0 is my external sd card mount directory(see the last line below):



    android@localhost:~$ cat /etc/mtab
    /dev/loop1 / ext4 rw,relatime,data=ordered 0 0
    proc /proc proc rw,relatime 0 0
    sys /sys sysfs rw,relatime 0 0
    tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
    devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
    tmpfs /dev/shm tmpfs rw,relatime 0 0
    /dev/block/vold/179:97 /storage/sdcard0 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0


    I have tried umount /storage/sdcard0 and remount it with option -o umask=0000 , but command ls -l /storage get same result as above.










    share|improve this question









    New contributor




    zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      4












      4








      4







      I am already a member of the group "aid_sdcard_rw":



      android@localhost:~$ whoami
      android
      android@localhost:~$ groups
      android aid_radio ...... aid_sdcard_rw ......


      you can see that i am already in group aid_sdcard_rw. Then, when i
      access directory /storage/sdcard0 :



      android@localhost:~$ ls /storage/sdcard0/
      ls: cannot open directory '/storage/sdcard0/': Permission denied


      but:



      android@localhost:~$ ls -l /storage/
      total 8
      d---rwxr-x 17 android aid_sdcard_rw 8192 1月 1 1970 sdcard0


      doesn't group "aid_sdcard_rw" members have read permission?
      why is this Permission denied happened?





      The system i run is an ubuntu 16.04 and running in my android phone using
      an app called Linux Deploy, and my phone have external sd card inserted :



      Welcome to Ubuntu 16.04 LTS (GNU/Linux 3.4.5 armv7l)

      * Documentation: https://help.ubuntu.com/
      Ubuntu 16.04 LTS [running via Linux Deploy]


      The directory /storage/sdcard0 is my external sd card mount directory(see the last line below):



      android@localhost:~$ cat /etc/mtab
      /dev/loop1 / ext4 rw,relatime,data=ordered 0 0
      proc /proc proc rw,relatime 0 0
      sys /sys sysfs rw,relatime 0 0
      tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
      devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
      tmpfs /dev/shm tmpfs rw,relatime 0 0
      /dev/block/vold/179:97 /storage/sdcard0 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0


      I have tried umount /storage/sdcard0 and remount it with option -o umask=0000 , but command ls -l /storage get same result as above.










      share|improve this question









      New contributor




      zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I am already a member of the group "aid_sdcard_rw":



      android@localhost:~$ whoami
      android
      android@localhost:~$ groups
      android aid_radio ...... aid_sdcard_rw ......


      you can see that i am already in group aid_sdcard_rw. Then, when i
      access directory /storage/sdcard0 :



      android@localhost:~$ ls /storage/sdcard0/
      ls: cannot open directory '/storage/sdcard0/': Permission denied


      but:



      android@localhost:~$ ls -l /storage/
      total 8
      d---rwxr-x 17 android aid_sdcard_rw 8192 1月 1 1970 sdcard0


      doesn't group "aid_sdcard_rw" members have read permission?
      why is this Permission denied happened?





      The system i run is an ubuntu 16.04 and running in my android phone using
      an app called Linux Deploy, and my phone have external sd card inserted :



      Welcome to Ubuntu 16.04 LTS (GNU/Linux 3.4.5 armv7l)

      * Documentation: https://help.ubuntu.com/
      Ubuntu 16.04 LTS [running via Linux Deploy]


      The directory /storage/sdcard0 is my external sd card mount directory(see the last line below):



      android@localhost:~$ cat /etc/mtab
      /dev/loop1 / ext4 rw,relatime,data=ordered 0 0
      proc /proc proc rw,relatime 0 0
      sys /sys sysfs rw,relatime 0 0
      tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
      devpts /dev/pts devpts rw,relatime,gid=5,mode=620 0 0
      tmpfs /dev/shm tmpfs rw,relatime 0 0
      /dev/block/vold/179:97 /storage/sdcard0 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0


      I have tried umount /storage/sdcard0 and remount it with option -o umask=0000 , but command ls -l /storage get same result as above.







      ubuntu permissions mount






      share|improve this question









      New contributor




      zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 2 days ago









      Kusalananda

      123k16232379




      123k16232379






      New contributor




      zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 days ago









      zeyang yuezeyang yue

      211




      211




      New contributor




      zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      zeyang yue is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          4 Answers
          4






          active

          oldest

          votes


















          7














          If the user that owns the file or directory is explicitly denied access to the file or directory through the permissions, then that user can not access the file or directory. It does not matter if the owner is a member of the group that has access.



          Or in other words, to access the file or directory as the owner, it has to allow access to the owner.



          In your case, you have a directory without x permissions for the owner. The owner can therefore not access the directory.



          To fix this, use



          chmod u+x /storage/sdcard0


          If the owner additionally needs to be able to list the contents of the directory, also give the owner r permissions. To create or delete files or subdirectories, you will need w permissions.



          You should be able to set the permissions on the directory with the card unmounted. When mounting the SD card, the permissions on the mount point should be inherited from the directory permissions.






          share|improve this answer































            5














            The android user is also the owner of the directory, owner that has no rights (even if android user is member of a valid group). The solution would be to change the owner of the directory with chown or try it with another user (that belongs to a valid group).






            share|improve this answer








            New contributor




            Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.


















            • You first said "even if android user is member of a valid group". Why would it then change anything if it was a different user belonging to a valid group? Also, why change the owner of the directory, when OP is the owner of the directory? Also, as you can see, the "others" entity also has read and execute permissions, so anyone on that system should be able to read that directory.
              – Larry
              2 days ago






            • 2




              @Larry because the file permission bits state that the owner does not have read, write or execute permissions on the directory. It seem like unusual permissions for the directory but that's what the permission bits are set to. A more suitable set of permissions would be 775
              – Torin
              2 days ago












            • @Torin: I see, thanks. But does chown also change the permissions that apply to the target user on the file? Otherwise, the other use will still be explicitly denied read permission.
              – Larry
              2 days ago






            • 2




              @Larri: chown changes the owner and group of the file/directory but does not affect to the permissions; if the permissions are 075, after the execution of chown they will keep same, but the permision 0 will affect to the new owner instead of to the "old" one.
              – Dasel
              2 days ago






            • 2




              @Larry chown-ing is one way to 'solve' the problem, but then the new owner has the issue that they can't access the directory (as long as they aren't root). chmod-ing would instead allow all users of the group, including the owner to have full permissions on the directory which is probably closer to solving it.
              – Torin
              2 days ago





















            3














            File permissions have a precedence order:




            • User permissions affect the owner of the file.

            • Group permissions affect everyone in the file's group.

            • Other permissions affect everyone else.


            The permissions aren't merged -- they're tested in order. This means the group permissions don't affect the owner, and other permissions don't affect the owner and group. This then permits the situation where wider sets of users can have more permissions than more specific ones -- this is occasionally useful when you have a file or directory that should generally be accessible, but you want to exclude a specific user or group.



            However, this is mostly ineffectual when it comes to excluding a user. The owner of a file also has permission to change its permissions, so the owner can do



            chmod u+rwx /storage/sdcard0


            However, if the user is in a restricted environment where they can't use chmod, this can be effective.






            share|improve this answer





























              0














              Try to execute like this:



              newgrp aid_sdcard_rw 
              ls /storage/sdcard0/





              share|improve this answer

















              • 2




                sorry, but this doesn't work. still get permission error. I guess @Dasel is right. when you are owner of an directory, then it will first apply that rule and ignore others.
                – zeyang yue
                2 days ago











              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
              });


              }
              });






              zeyang yue is a new contributor. Be nice, and check out our Code of Conduct.










              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493211%2fwhy-cant-i-have-permission-in-that-group-which-i-already-in%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              7














              If the user that owns the file or directory is explicitly denied access to the file or directory through the permissions, then that user can not access the file or directory. It does not matter if the owner is a member of the group that has access.



              Or in other words, to access the file or directory as the owner, it has to allow access to the owner.



              In your case, you have a directory without x permissions for the owner. The owner can therefore not access the directory.



              To fix this, use



              chmod u+x /storage/sdcard0


              If the owner additionally needs to be able to list the contents of the directory, also give the owner r permissions. To create or delete files or subdirectories, you will need w permissions.



              You should be able to set the permissions on the directory with the card unmounted. When mounting the SD card, the permissions on the mount point should be inherited from the directory permissions.






              share|improve this answer




























                7














                If the user that owns the file or directory is explicitly denied access to the file or directory through the permissions, then that user can not access the file or directory. It does not matter if the owner is a member of the group that has access.



                Or in other words, to access the file or directory as the owner, it has to allow access to the owner.



                In your case, you have a directory without x permissions for the owner. The owner can therefore not access the directory.



                To fix this, use



                chmod u+x /storage/sdcard0


                If the owner additionally needs to be able to list the contents of the directory, also give the owner r permissions. To create or delete files or subdirectories, you will need w permissions.



                You should be able to set the permissions on the directory with the card unmounted. When mounting the SD card, the permissions on the mount point should be inherited from the directory permissions.






                share|improve this answer


























                  7












                  7








                  7






                  If the user that owns the file or directory is explicitly denied access to the file or directory through the permissions, then that user can not access the file or directory. It does not matter if the owner is a member of the group that has access.



                  Or in other words, to access the file or directory as the owner, it has to allow access to the owner.



                  In your case, you have a directory without x permissions for the owner. The owner can therefore not access the directory.



                  To fix this, use



                  chmod u+x /storage/sdcard0


                  If the owner additionally needs to be able to list the contents of the directory, also give the owner r permissions. To create or delete files or subdirectories, you will need w permissions.



                  You should be able to set the permissions on the directory with the card unmounted. When mounting the SD card, the permissions on the mount point should be inherited from the directory permissions.






                  share|improve this answer














                  If the user that owns the file or directory is explicitly denied access to the file or directory through the permissions, then that user can not access the file or directory. It does not matter if the owner is a member of the group that has access.



                  Or in other words, to access the file or directory as the owner, it has to allow access to the owner.



                  In your case, you have a directory without x permissions for the owner. The owner can therefore not access the directory.



                  To fix this, use



                  chmod u+x /storage/sdcard0


                  If the owner additionally needs to be able to list the contents of the directory, also give the owner r permissions. To create or delete files or subdirectories, you will need w permissions.



                  You should be able to set the permissions on the directory with the card unmounted. When mounting the SD card, the permissions on the mount point should be inherited from the directory permissions.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 2 days ago

























                  answered 2 days ago









                  KusalanandaKusalananda

                  123k16232379




                  123k16232379

























                      5














                      The android user is also the owner of the directory, owner that has no rights (even if android user is member of a valid group). The solution would be to change the owner of the directory with chown or try it with another user (that belongs to a valid group).






                      share|improve this answer








                      New contributor




                      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.


















                      • You first said "even if android user is member of a valid group". Why would it then change anything if it was a different user belonging to a valid group? Also, why change the owner of the directory, when OP is the owner of the directory? Also, as you can see, the "others" entity also has read and execute permissions, so anyone on that system should be able to read that directory.
                        – Larry
                        2 days ago






                      • 2




                        @Larry because the file permission bits state that the owner does not have read, write or execute permissions on the directory. It seem like unusual permissions for the directory but that's what the permission bits are set to. A more suitable set of permissions would be 775
                        – Torin
                        2 days ago












                      • @Torin: I see, thanks. But does chown also change the permissions that apply to the target user on the file? Otherwise, the other use will still be explicitly denied read permission.
                        – Larry
                        2 days ago






                      • 2




                        @Larri: chown changes the owner and group of the file/directory but does not affect to the permissions; if the permissions are 075, after the execution of chown they will keep same, but the permision 0 will affect to the new owner instead of to the "old" one.
                        – Dasel
                        2 days ago






                      • 2




                        @Larry chown-ing is one way to 'solve' the problem, but then the new owner has the issue that they can't access the directory (as long as they aren't root). chmod-ing would instead allow all users of the group, including the owner to have full permissions on the directory which is probably closer to solving it.
                        – Torin
                        2 days ago


















                      5














                      The android user is also the owner of the directory, owner that has no rights (even if android user is member of a valid group). The solution would be to change the owner of the directory with chown or try it with another user (that belongs to a valid group).






                      share|improve this answer








                      New contributor




                      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.


















                      • You first said "even if android user is member of a valid group". Why would it then change anything if it was a different user belonging to a valid group? Also, why change the owner of the directory, when OP is the owner of the directory? Also, as you can see, the "others" entity also has read and execute permissions, so anyone on that system should be able to read that directory.
                        – Larry
                        2 days ago






                      • 2




                        @Larry because the file permission bits state that the owner does not have read, write or execute permissions on the directory. It seem like unusual permissions for the directory but that's what the permission bits are set to. A more suitable set of permissions would be 775
                        – Torin
                        2 days ago












                      • @Torin: I see, thanks. But does chown also change the permissions that apply to the target user on the file? Otherwise, the other use will still be explicitly denied read permission.
                        – Larry
                        2 days ago






                      • 2




                        @Larri: chown changes the owner and group of the file/directory but does not affect to the permissions; if the permissions are 075, after the execution of chown they will keep same, but the permision 0 will affect to the new owner instead of to the "old" one.
                        – Dasel
                        2 days ago






                      • 2




                        @Larry chown-ing is one way to 'solve' the problem, but then the new owner has the issue that they can't access the directory (as long as they aren't root). chmod-ing would instead allow all users of the group, including the owner to have full permissions on the directory which is probably closer to solving it.
                        – Torin
                        2 days ago
















                      5












                      5








                      5






                      The android user is also the owner of the directory, owner that has no rights (even if android user is member of a valid group). The solution would be to change the owner of the directory with chown or try it with another user (that belongs to a valid group).






                      share|improve this answer








                      New contributor




                      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      The android user is also the owner of the directory, owner that has no rights (even if android user is member of a valid group). The solution would be to change the owner of the directory with chown or try it with another user (that belongs to a valid group).







                      share|improve this answer








                      New contributor




                      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      share|improve this answer



                      share|improve this answer






                      New contributor




                      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      answered 2 days ago









                      DaselDasel

                      1415




                      1415




                      New contributor




                      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





                      New contributor





                      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






                      Dasel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.












                      • You first said "even if android user is member of a valid group". Why would it then change anything if it was a different user belonging to a valid group? Also, why change the owner of the directory, when OP is the owner of the directory? Also, as you can see, the "others" entity also has read and execute permissions, so anyone on that system should be able to read that directory.
                        – Larry
                        2 days ago






                      • 2




                        @Larry because the file permission bits state that the owner does not have read, write or execute permissions on the directory. It seem like unusual permissions for the directory but that's what the permission bits are set to. A more suitable set of permissions would be 775
                        – Torin
                        2 days ago












                      • @Torin: I see, thanks. But does chown also change the permissions that apply to the target user on the file? Otherwise, the other use will still be explicitly denied read permission.
                        – Larry
                        2 days ago






                      • 2




                        @Larri: chown changes the owner and group of the file/directory but does not affect to the permissions; if the permissions are 075, after the execution of chown they will keep same, but the permision 0 will affect to the new owner instead of to the "old" one.
                        – Dasel
                        2 days ago






                      • 2




                        @Larry chown-ing is one way to 'solve' the problem, but then the new owner has the issue that they can't access the directory (as long as they aren't root). chmod-ing would instead allow all users of the group, including the owner to have full permissions on the directory which is probably closer to solving it.
                        – Torin
                        2 days ago




















                      • You first said "even if android user is member of a valid group". Why would it then change anything if it was a different user belonging to a valid group? Also, why change the owner of the directory, when OP is the owner of the directory? Also, as you can see, the "others" entity also has read and execute permissions, so anyone on that system should be able to read that directory.
                        – Larry
                        2 days ago






                      • 2




                        @Larry because the file permission bits state that the owner does not have read, write or execute permissions on the directory. It seem like unusual permissions for the directory but that's what the permission bits are set to. A more suitable set of permissions would be 775
                        – Torin
                        2 days ago












                      • @Torin: I see, thanks. But does chown also change the permissions that apply to the target user on the file? Otherwise, the other use will still be explicitly denied read permission.
                        – Larry
                        2 days ago






                      • 2




                        @Larri: chown changes the owner and group of the file/directory but does not affect to the permissions; if the permissions are 075, after the execution of chown they will keep same, but the permision 0 will affect to the new owner instead of to the "old" one.
                        – Dasel
                        2 days ago






                      • 2




                        @Larry chown-ing is one way to 'solve' the problem, but then the new owner has the issue that they can't access the directory (as long as they aren't root). chmod-ing would instead allow all users of the group, including the owner to have full permissions on the directory which is probably closer to solving it.
                        – Torin
                        2 days ago


















                      You first said "even if android user is member of a valid group". Why would it then change anything if it was a different user belonging to a valid group? Also, why change the owner of the directory, when OP is the owner of the directory? Also, as you can see, the "others" entity also has read and execute permissions, so anyone on that system should be able to read that directory.
                      – Larry
                      2 days ago




                      You first said "even if android user is member of a valid group". Why would it then change anything if it was a different user belonging to a valid group? Also, why change the owner of the directory, when OP is the owner of the directory? Also, as you can see, the "others" entity also has read and execute permissions, so anyone on that system should be able to read that directory.
                      – Larry
                      2 days ago




                      2




                      2




                      @Larry because the file permission bits state that the owner does not have read, write or execute permissions on the directory. It seem like unusual permissions for the directory but that's what the permission bits are set to. A more suitable set of permissions would be 775
                      – Torin
                      2 days ago






                      @Larry because the file permission bits state that the owner does not have read, write or execute permissions on the directory. It seem like unusual permissions for the directory but that's what the permission bits are set to. A more suitable set of permissions would be 775
                      – Torin
                      2 days ago














                      @Torin: I see, thanks. But does chown also change the permissions that apply to the target user on the file? Otherwise, the other use will still be explicitly denied read permission.
                      – Larry
                      2 days ago




                      @Torin: I see, thanks. But does chown also change the permissions that apply to the target user on the file? Otherwise, the other use will still be explicitly denied read permission.
                      – Larry
                      2 days ago




                      2




                      2




                      @Larri: chown changes the owner and group of the file/directory but does not affect to the permissions; if the permissions are 075, after the execution of chown they will keep same, but the permision 0 will affect to the new owner instead of to the "old" one.
                      – Dasel
                      2 days ago




                      @Larri: chown changes the owner and group of the file/directory but does not affect to the permissions; if the permissions are 075, after the execution of chown they will keep same, but the permision 0 will affect to the new owner instead of to the "old" one.
                      – Dasel
                      2 days ago




                      2




                      2




                      @Larry chown-ing is one way to 'solve' the problem, but then the new owner has the issue that they can't access the directory (as long as they aren't root). chmod-ing would instead allow all users of the group, including the owner to have full permissions on the directory which is probably closer to solving it.
                      – Torin
                      2 days ago






                      @Larry chown-ing is one way to 'solve' the problem, but then the new owner has the issue that they can't access the directory (as long as they aren't root). chmod-ing would instead allow all users of the group, including the owner to have full permissions on the directory which is probably closer to solving it.
                      – Torin
                      2 days ago













                      3














                      File permissions have a precedence order:




                      • User permissions affect the owner of the file.

                      • Group permissions affect everyone in the file's group.

                      • Other permissions affect everyone else.


                      The permissions aren't merged -- they're tested in order. This means the group permissions don't affect the owner, and other permissions don't affect the owner and group. This then permits the situation where wider sets of users can have more permissions than more specific ones -- this is occasionally useful when you have a file or directory that should generally be accessible, but you want to exclude a specific user or group.



                      However, this is mostly ineffectual when it comes to excluding a user. The owner of a file also has permission to change its permissions, so the owner can do



                      chmod u+rwx /storage/sdcard0


                      However, if the user is in a restricted environment where they can't use chmod, this can be effective.






                      share|improve this answer


























                        3














                        File permissions have a precedence order:




                        • User permissions affect the owner of the file.

                        • Group permissions affect everyone in the file's group.

                        • Other permissions affect everyone else.


                        The permissions aren't merged -- they're tested in order. This means the group permissions don't affect the owner, and other permissions don't affect the owner and group. This then permits the situation where wider sets of users can have more permissions than more specific ones -- this is occasionally useful when you have a file or directory that should generally be accessible, but you want to exclude a specific user or group.



                        However, this is mostly ineffectual when it comes to excluding a user. The owner of a file also has permission to change its permissions, so the owner can do



                        chmod u+rwx /storage/sdcard0


                        However, if the user is in a restricted environment where they can't use chmod, this can be effective.






                        share|improve this answer
























                          3












                          3








                          3






                          File permissions have a precedence order:




                          • User permissions affect the owner of the file.

                          • Group permissions affect everyone in the file's group.

                          • Other permissions affect everyone else.


                          The permissions aren't merged -- they're tested in order. This means the group permissions don't affect the owner, and other permissions don't affect the owner and group. This then permits the situation where wider sets of users can have more permissions than more specific ones -- this is occasionally useful when you have a file or directory that should generally be accessible, but you want to exclude a specific user or group.



                          However, this is mostly ineffectual when it comes to excluding a user. The owner of a file also has permission to change its permissions, so the owner can do



                          chmod u+rwx /storage/sdcard0


                          However, if the user is in a restricted environment where they can't use chmod, this can be effective.






                          share|improve this answer












                          File permissions have a precedence order:




                          • User permissions affect the owner of the file.

                          • Group permissions affect everyone in the file's group.

                          • Other permissions affect everyone else.


                          The permissions aren't merged -- they're tested in order. This means the group permissions don't affect the owner, and other permissions don't affect the owner and group. This then permits the situation where wider sets of users can have more permissions than more specific ones -- this is occasionally useful when you have a file or directory that should generally be accessible, but you want to exclude a specific user or group.



                          However, this is mostly ineffectual when it comes to excluding a user. The owner of a file also has permission to change its permissions, so the owner can do



                          chmod u+rwx /storage/sdcard0


                          However, if the user is in a restricted environment where they can't use chmod, this can be effective.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 2 days ago









                          BarmarBarmar

                          6,9931223




                          6,9931223























                              0














                              Try to execute like this:



                              newgrp aid_sdcard_rw 
                              ls /storage/sdcard0/





                              share|improve this answer

















                              • 2




                                sorry, but this doesn't work. still get permission error. I guess @Dasel is right. when you are owner of an directory, then it will first apply that rule and ignore others.
                                – zeyang yue
                                2 days ago
















                              0














                              Try to execute like this:



                              newgrp aid_sdcard_rw 
                              ls /storage/sdcard0/





                              share|improve this answer

















                              • 2




                                sorry, but this doesn't work. still get permission error. I guess @Dasel is right. when you are owner of an directory, then it will first apply that rule and ignore others.
                                – zeyang yue
                                2 days ago














                              0












                              0








                              0






                              Try to execute like this:



                              newgrp aid_sdcard_rw 
                              ls /storage/sdcard0/





                              share|improve this answer












                              Try to execute like this:



                              newgrp aid_sdcard_rw 
                              ls /storage/sdcard0/






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered 2 days ago









                              Romeo NinovRomeo Ninov

                              5,39731827




                              5,39731827








                              • 2




                                sorry, but this doesn't work. still get permission error. I guess @Dasel is right. when you are owner of an directory, then it will first apply that rule and ignore others.
                                – zeyang yue
                                2 days ago














                              • 2




                                sorry, but this doesn't work. still get permission error. I guess @Dasel is right. when you are owner of an directory, then it will first apply that rule and ignore others.
                                – zeyang yue
                                2 days ago








                              2




                              2




                              sorry, but this doesn't work. still get permission error. I guess @Dasel is right. when you are owner of an directory, then it will first apply that rule and ignore others.
                              – zeyang yue
                              2 days ago




                              sorry, but this doesn't work. still get permission error. I guess @Dasel is right. when you are owner of an directory, then it will first apply that rule and ignore others.
                              – zeyang yue
                              2 days ago










                              zeyang yue is a new contributor. Be nice, and check out our Code of Conduct.










                              draft saved

                              draft discarded


















                              zeyang yue is a new contributor. Be nice, and check out our Code of Conduct.













                              zeyang yue is a new contributor. Be nice, and check out our Code of Conduct.












                              zeyang yue is a new contributor. Be nice, and check out our Code of Conduct.
















                              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%2f493211%2fwhy-cant-i-have-permission-in-that-group-which-i-already-in%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

                              An IMO inspired problem

                              Management

                              Investment