Permission denied even though I own it and permissions are 777












2















I'm on Android using Termux and copied a file from my sdcard to my Termux home folder. (I use a file explorer app with root permissions for that..)
Now having the file in my home dir I checked what my user name and groups are and set me as the owner of that file and also set permissions to 777.



$ whoami
u0_a87
$ groups
u0_a87
$ su -c chown u0_a87:u0_a87 Files.zip
$ su -c chmod 777 Files.zip
$ ls -la
total 7292
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:13 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip$ unzip
Files.zip
unzip: can't open Files.zip[.zip]
$ cat Files.zip
cat: Files.zip: Permission denied


Why is it that I can still not access it?



This worked just fine btw:



$ mkdir test
$ zip -r test.zip test
adding: test/ (stored 0%)
$ ls -la
total 7300
drwx------ 3 u0_a87 u0_a87 4096 Jul 22 09:31 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:31 test
-rw------- 1 u0_a87 u0_a87 160 Jul 22 09:31 test.zip
$ rm -rf test
$ unzip test.zip
Archive: test.zip
$ unzip test.zip
Archive: test.zip
$ ls -la
total 7300
drwx------ 3 u0_a87 u0_a87 4096 Jul 22 09:31 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:31 test
-rw------- 1 u0_a87 u0_a87 160 Jul 22 09:31 test.zip


What am I missing, how can I get access to that file from my user account without using su/sudo etc?



I also tried to find out if there are any extended attributes on that file. According to the internet ls -l would have shown me that there are extended attributes with a + character (e.g. -rwxrwxrwx+). As you can see above this was not the case. Just to be sure, I also checked using the attr command:



$ attr -l ./Files.zip
Attribute "selinux" has a 28 byte value for ./Files.zip
$ attr -g selinux ./Files.zip
attr_get: No data available
Could not get "selinux" for ./Files.zip
$ su -c attr -l ./Files.zip
sush: attr: not found
$ su -c attr -g selinux ./Files.zip
sush: attr: not found


The results were unclear to me. I don't understand why it tells me there is an "selinux" attribute, but then refuses to give me the value and then when I try with su -c it does't even list the "selinux" attribute, not to mention that getting the value fails.










share|improve this question
















bumped to the homepage by Community 11 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Im guessing this could be caused by extended attributes. But usually this is indicated with a + sign in the permissions. You could try to do ls -l@

    – Peter
    Jul 22 '17 at 8:26











  • ls: invalid option -- '@' I don't think that exists on Android. I also checked --help, couldn't find anything about extended attributes. From all I know ls -l automatically shows extended attributes if there are any. So I doubt that there are are any extended attributes on my files.

    – Forivin
    Jul 22 '17 at 9:17











  • What does unzip -l Files.zip and unzip -t Files.zip output?

    – Tigger
    Dec 28 '17 at 6:14
















2















I'm on Android using Termux and copied a file from my sdcard to my Termux home folder. (I use a file explorer app with root permissions for that..)
Now having the file in my home dir I checked what my user name and groups are and set me as the owner of that file and also set permissions to 777.



$ whoami
u0_a87
$ groups
u0_a87
$ su -c chown u0_a87:u0_a87 Files.zip
$ su -c chmod 777 Files.zip
$ ls -la
total 7292
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:13 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip$ unzip
Files.zip
unzip: can't open Files.zip[.zip]
$ cat Files.zip
cat: Files.zip: Permission denied


Why is it that I can still not access it?



This worked just fine btw:



$ mkdir test
$ zip -r test.zip test
adding: test/ (stored 0%)
$ ls -la
total 7300
drwx------ 3 u0_a87 u0_a87 4096 Jul 22 09:31 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:31 test
-rw------- 1 u0_a87 u0_a87 160 Jul 22 09:31 test.zip
$ rm -rf test
$ unzip test.zip
Archive: test.zip
$ unzip test.zip
Archive: test.zip
$ ls -la
total 7300
drwx------ 3 u0_a87 u0_a87 4096 Jul 22 09:31 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:31 test
-rw------- 1 u0_a87 u0_a87 160 Jul 22 09:31 test.zip


What am I missing, how can I get access to that file from my user account without using su/sudo etc?



I also tried to find out if there are any extended attributes on that file. According to the internet ls -l would have shown me that there are extended attributes with a + character (e.g. -rwxrwxrwx+). As you can see above this was not the case. Just to be sure, I also checked using the attr command:



$ attr -l ./Files.zip
Attribute "selinux" has a 28 byte value for ./Files.zip
$ attr -g selinux ./Files.zip
attr_get: No data available
Could not get "selinux" for ./Files.zip
$ su -c attr -l ./Files.zip
sush: attr: not found
$ su -c attr -g selinux ./Files.zip
sush: attr: not found


The results were unclear to me. I don't understand why it tells me there is an "selinux" attribute, but then refuses to give me the value and then when I try with su -c it does't even list the "selinux" attribute, not to mention that getting the value fails.










share|improve this question
















bumped to the homepage by Community 11 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Im guessing this could be caused by extended attributes. But usually this is indicated with a + sign in the permissions. You could try to do ls -l@

    – Peter
    Jul 22 '17 at 8:26











  • ls: invalid option -- '@' I don't think that exists on Android. I also checked --help, couldn't find anything about extended attributes. From all I know ls -l automatically shows extended attributes if there are any. So I doubt that there are are any extended attributes on my files.

    – Forivin
    Jul 22 '17 at 9:17











  • What does unzip -l Files.zip and unzip -t Files.zip output?

    – Tigger
    Dec 28 '17 at 6:14














2












2








2








I'm on Android using Termux and copied a file from my sdcard to my Termux home folder. (I use a file explorer app with root permissions for that..)
Now having the file in my home dir I checked what my user name and groups are and set me as the owner of that file and also set permissions to 777.



$ whoami
u0_a87
$ groups
u0_a87
$ su -c chown u0_a87:u0_a87 Files.zip
$ su -c chmod 777 Files.zip
$ ls -la
total 7292
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:13 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip$ unzip
Files.zip
unzip: can't open Files.zip[.zip]
$ cat Files.zip
cat: Files.zip: Permission denied


Why is it that I can still not access it?



This worked just fine btw:



$ mkdir test
$ zip -r test.zip test
adding: test/ (stored 0%)
$ ls -la
total 7300
drwx------ 3 u0_a87 u0_a87 4096 Jul 22 09:31 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:31 test
-rw------- 1 u0_a87 u0_a87 160 Jul 22 09:31 test.zip
$ rm -rf test
$ unzip test.zip
Archive: test.zip
$ unzip test.zip
Archive: test.zip
$ ls -la
total 7300
drwx------ 3 u0_a87 u0_a87 4096 Jul 22 09:31 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:31 test
-rw------- 1 u0_a87 u0_a87 160 Jul 22 09:31 test.zip


What am I missing, how can I get access to that file from my user account without using su/sudo etc?



I also tried to find out if there are any extended attributes on that file. According to the internet ls -l would have shown me that there are extended attributes with a + character (e.g. -rwxrwxrwx+). As you can see above this was not the case. Just to be sure, I also checked using the attr command:



$ attr -l ./Files.zip
Attribute "selinux" has a 28 byte value for ./Files.zip
$ attr -g selinux ./Files.zip
attr_get: No data available
Could not get "selinux" for ./Files.zip
$ su -c attr -l ./Files.zip
sush: attr: not found
$ su -c attr -g selinux ./Files.zip
sush: attr: not found


The results were unclear to me. I don't understand why it tells me there is an "selinux" attribute, but then refuses to give me the value and then when I try with su -c it does't even list the "selinux" attribute, not to mention that getting the value fails.










share|improve this question
















I'm on Android using Termux and copied a file from my sdcard to my Termux home folder. (I use a file explorer app with root permissions for that..)
Now having the file in my home dir I checked what my user name and groups are and set me as the owner of that file and also set permissions to 777.



$ whoami
u0_a87
$ groups
u0_a87
$ su -c chown u0_a87:u0_a87 Files.zip
$ su -c chmod 777 Files.zip
$ ls -la
total 7292
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:13 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip$ unzip
Files.zip
unzip: can't open Files.zip[.zip]
$ cat Files.zip
cat: Files.zip: Permission denied


Why is it that I can still not access it?



This worked just fine btw:



$ mkdir test
$ zip -r test.zip test
adding: test/ (stored 0%)
$ ls -la
total 7300
drwx------ 3 u0_a87 u0_a87 4096 Jul 22 09:31 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:31 test
-rw------- 1 u0_a87 u0_a87 160 Jul 22 09:31 test.zip
$ rm -rf test
$ unzip test.zip
Archive: test.zip
$ unzip test.zip
Archive: test.zip
$ ls -la
total 7300
drwx------ 3 u0_a87 u0_a87 4096 Jul 22 09:31 .
drwx------ 4 u0_a87 u0_a87 4096 Jul 22 09:13 ..
-rwxrwxrwx 1 u0_a87 u0_a87 7454766 Jul 22 01:24 Files.zip
drwx------ 2 u0_a87 u0_a87 4096 Jul 22 09:31 test
-rw------- 1 u0_a87 u0_a87 160 Jul 22 09:31 test.zip


What am I missing, how can I get access to that file from my user account without using su/sudo etc?



I also tried to find out if there are any extended attributes on that file. According to the internet ls -l would have shown me that there are extended attributes with a + character (e.g. -rwxrwxrwx+). As you can see above this was not the case. Just to be sure, I also checked using the attr command:



$ attr -l ./Files.zip
Attribute "selinux" has a 28 byte value for ./Files.zip
$ attr -g selinux ./Files.zip
attr_get: No data available
Could not get "selinux" for ./Files.zip
$ su -c attr -l ./Files.zip
sush: attr: not found
$ su -c attr -g selinux ./Files.zip
sush: attr: not found


The results were unclear to me. I don't understand why it tells me there is an "selinux" attribute, but then refuses to give me the value and then when I try with su -c it does't even list the "selinux" attribute, not to mention that getting the value fails.







permissions android chmod chown terminal-emulator






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 22 '17 at 15:19







Forivin

















asked Jul 22 '17 at 7:45









ForivinForivin

210216




210216





bumped to the homepage by Community 11 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 11 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Im guessing this could be caused by extended attributes. But usually this is indicated with a + sign in the permissions. You could try to do ls -l@

    – Peter
    Jul 22 '17 at 8:26











  • ls: invalid option -- '@' I don't think that exists on Android. I also checked --help, couldn't find anything about extended attributes. From all I know ls -l automatically shows extended attributes if there are any. So I doubt that there are are any extended attributes on my files.

    – Forivin
    Jul 22 '17 at 9:17











  • What does unzip -l Files.zip and unzip -t Files.zip output?

    – Tigger
    Dec 28 '17 at 6:14



















  • Im guessing this could be caused by extended attributes. But usually this is indicated with a + sign in the permissions. You could try to do ls -l@

    – Peter
    Jul 22 '17 at 8:26











  • ls: invalid option -- '@' I don't think that exists on Android. I also checked --help, couldn't find anything about extended attributes. From all I know ls -l automatically shows extended attributes if there are any. So I doubt that there are are any extended attributes on my files.

    – Forivin
    Jul 22 '17 at 9:17











  • What does unzip -l Files.zip and unzip -t Files.zip output?

    – Tigger
    Dec 28 '17 at 6:14

















Im guessing this could be caused by extended attributes. But usually this is indicated with a + sign in the permissions. You could try to do ls -l@

– Peter
Jul 22 '17 at 8:26





Im guessing this could be caused by extended attributes. But usually this is indicated with a + sign in the permissions. You could try to do ls -l@

– Peter
Jul 22 '17 at 8:26













ls: invalid option -- '@' I don't think that exists on Android. I also checked --help, couldn't find anything about extended attributes. From all I know ls -l automatically shows extended attributes if there are any. So I doubt that there are are any extended attributes on my files.

– Forivin
Jul 22 '17 at 9:17





ls: invalid option -- '@' I don't think that exists on Android. I also checked --help, couldn't find anything about extended attributes. From all I know ls -l automatically shows extended attributes if there are any. So I doubt that there are are any extended attributes on my files.

– Forivin
Jul 22 '17 at 9:17













What does unzip -l Files.zip and unzip -t Files.zip output?

– Tigger
Dec 28 '17 at 6:14





What does unzip -l Files.zip and unzip -t Files.zip output?

– Tigger
Dec 28 '17 at 6:14










1 Answer
1






active

oldest

votes


















0














I'm had the exact same problem. While I don't understand what exactly is happening here, the workaround is to not use a separate file explorer to copy the files. Instead make sure that termux has the relevant android permissions (settings -> apps -> permissions; and/or execute termux-setup-storage).



In your termux home folder should be another folder called storage, which symlinks to your sdcard.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f381070%2fpermission-denied-even-though-i-own-it-and-permissions-are-777%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I'm had the exact same problem. While I don't understand what exactly is happening here, the workaround is to not use a separate file explorer to copy the files. Instead make sure that termux has the relevant android permissions (settings -> apps -> permissions; and/or execute termux-setup-storage).



    In your termux home folder should be another folder called storage, which symlinks to your sdcard.






    share|improve this answer




























      0














      I'm had the exact same problem. While I don't understand what exactly is happening here, the workaround is to not use a separate file explorer to copy the files. Instead make sure that termux has the relevant android permissions (settings -> apps -> permissions; and/or execute termux-setup-storage).



      In your termux home folder should be another folder called storage, which symlinks to your sdcard.






      share|improve this answer


























        0












        0








        0







        I'm had the exact same problem. While I don't understand what exactly is happening here, the workaround is to not use a separate file explorer to copy the files. Instead make sure that termux has the relevant android permissions (settings -> apps -> permissions; and/or execute termux-setup-storage).



        In your termux home folder should be another folder called storage, which symlinks to your sdcard.






        share|improve this answer













        I'm had the exact same problem. While I don't understand what exactly is happening here, the workaround is to not use a separate file explorer to copy the files. Instead make sure that termux has the relevant android permissions (settings -> apps -> permissions; and/or execute termux-setup-storage).



        In your termux home folder should be another folder called storage, which symlinks to your sdcard.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 27 '17 at 23:20









        panditapandita

        251620




        251620






























            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%2f381070%2fpermission-denied-even-though-i-own-it-and-permissions-are-777%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

            Loup dans la culture

            How to solve the problem of ntp “Unable to contact time server” from KDE?

            ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux