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





























    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



























      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
















      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















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 8 at 13:29









      Kusalananda

      127k16239394




      127k16239394










      asked Jan 8 at 12:19









      zeyang yuezeyang yue

      211




      211






















          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
























            • 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
              Jan 8 at 13:00






            • 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
              Jan 8 at 13:22













            • @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
              Jan 8 at 14:21






            • 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
              Jan 8 at 14:28






            • 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
              Jan 8 at 14:38





















            4














            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
                Jan 8 at 13:16











              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%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 Jan 8 at 13:37

























                  answered Jan 8 at 13:23









                  KusalanandaKusalananda

                  127k16239394




                  127k16239394

























                      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
























                      • 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
                        Jan 8 at 13:00






                      • 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
                        Jan 8 at 13:22













                      • @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
                        Jan 8 at 14:21






                      • 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
                        Jan 8 at 14:28






                      • 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
                        Jan 8 at 14:38


















                      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
























                      • 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
                        Jan 8 at 13:00






                      • 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
                        Jan 8 at 13:22













                      • @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
                        Jan 8 at 14:21






                      • 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
                        Jan 8 at 14:28






                      • 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
                        Jan 8 at 14:38
















                      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













                      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












                      share|improve this answer



                      share|improve this answer










                      answered Jan 8 at 12:33









                      DaselDasel

                      4497




                      4497













                      • 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
                        Jan 8 at 13:00






                      • 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
                        Jan 8 at 13:22













                      • @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
                        Jan 8 at 14:21






                      • 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
                        Jan 8 at 14:28






                      • 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
                        Jan 8 at 14:38





















                      • 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
                        Jan 8 at 13:00






                      • 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
                        Jan 8 at 13:22













                      • @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
                        Jan 8 at 14:21






                      • 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
                        Jan 8 at 14:28






                      • 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
                        Jan 8 at 14:38



















                      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
                      Jan 8 at 13:00





                      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
                      Jan 8 at 13:00




                      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
                      Jan 8 at 13:22







                      @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
                      Jan 8 at 13:22















                      @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
                      Jan 8 at 14:21





                      @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
                      Jan 8 at 14:21




                      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
                      Jan 8 at 14:28





                      @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
                      Jan 8 at 14:28




                      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
                      Jan 8 at 14:38







                      @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
                      Jan 8 at 14:38













                      4














                      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




























                        4














                        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


























                          4












                          4








                          4







                          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 Jan 8 at 17:33









                          BarmarBarmar

                          7,0131223




                          7,0131223























                              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
                                Jan 8 at 13:16
















                              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
                                Jan 8 at 13:16














                              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 Jan 8 at 12:30









                              Romeo NinovRomeo Ninov

                              5,92332028




                              5,92332028








                              • 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
                                Jan 8 at 13:16














                              • 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
                                Jan 8 at 13:16








                              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
                              Jan 8 at 13:16





                              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
                              Jan 8 at 13:16


















                              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%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

                              MongoDB - Not Authorized To Execute Command

                              How to fix TextFormField cause rebuild widget in Flutter

                              in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith