Find all files a user can read from The 2019 Stack Overflow Developer Survey Results Are...

How to create dashed lines/arrows in Illustrator

Is domain driven design an anti-SQL pattern?

Where does the "burst of radiance" from Holy Weapon originate?

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Is this food a bread or a loaf?

Should I write numbers in words or as numerals when there are multiple next to each other?

Carnot-Caratheodory metric

What is this 4-propeller plane?

What does "rabbited" mean/imply in this sentence?

Geography at the pixel level

What effect does the “loading” weapon property have in practical terms?

What does "sndry explns" mean in one of the Hitchhiker's guide books?

I looked up a future colleague on LinkedIn before I started a job. I told my colleague about it and he seemed surprised. Should I apologize?

Where to refill my bottle in India?

Is there a name of the flying bionic bird?

How to answer pointed "are you quitting" questioning when I don't want them to suspect

How to change the limits of integration

aging parents with no investments

What tool would a Roman-age civilization have to grind silver and other metals into dust?

How to reverse every other sublist of a list?

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?

Does duplicating a spell with Wish count as casting that spell?

A poker game description that does not feel gimmicky

CiviEvent: Public link for events of a specific type



Find all files a user can read from



The 2019 Stack Overflow Developer Survey Results Are Inrecursively change file permission but not directories?POSIX find all local filesFind files that a user can not read?find command doesn't find (readable) files as non-root userhp-ux find command not working on a list of filesfind modified files recursively and copy with directory preserving directory structureHow to pass files found by find as arguments?How to find specific file types and tar them?find can't list all filesFind all files containing keywords





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















At first, I wanted to simply use:



find /etc -type f -perm -004 


And it did work. But then there were two files from which a current user could not read, but a group this user was in could access it anyway. So it didn't work properly.

I think this problem is solvable by writing a small script and iterating over each group. But is there a simpler way around it?










share|improve this question







New contributor




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



























    1















    At first, I wanted to simply use:



    find /etc -type f -perm -004 


    And it did work. But then there were two files from which a current user could not read, but a group this user was in could access it anyway. So it didn't work properly.

    I think this problem is solvable by writing a small script and iterating over each group. But is there a simpler way around it?










    share|improve this question







    New contributor




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























      1












      1








      1








      At first, I wanted to simply use:



      find /etc -type f -perm -004 


      And it did work. But then there were two files from which a current user could not read, but a group this user was in could access it anyway. So it didn't work properly.

      I think this problem is solvable by writing a small script and iterating over each group. But is there a simpler way around it?










      share|improve this question







      New contributor




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












      At first, I wanted to simply use:



      find /etc -type f -perm -004 


      And it did work. But then there were two files from which a current user could not read, but a group this user was in could access it anyway. So it didn't work properly.

      I think this problem is solvable by writing a small script and iterating over each group. But is there a simpler way around it?







      find






      share|improve this question







      New contributor




      RowanStone 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




      RowanStone 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






      New contributor




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









      asked yesterday









      RowanStoneRowanStone

      82




      82




      New contributor




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





      New contributor





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






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






















          1 Answer
          1






          active

          oldest

          votes


















          3














          Try:



          find /etc -type f -readable


          From man find:




          -readable

          Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
          -perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
          UID mapping (or root-squashing), since many systems implement
          access(2) in the client's kernel and so cannot make use
          of the UID mapping information held on the server.




          Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)






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


            }
            });






            RowanStone 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%2f511324%2ffind-all-files-a-user-can-read-from%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









            3














            Try:



            find /etc -type f -readable


            From man find:




            -readable

            Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
            -perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
            UID mapping (or root-squashing), since many systems implement
            access(2) in the client's kernel and so cannot make use
            of the UID mapping information held on the server.




            Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)






            share|improve this answer






























              3














              Try:



              find /etc -type f -readable


              From man find:




              -readable

              Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
              -perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
              UID mapping (or root-squashing), since many systems implement
              access(2) in the client's kernel and so cannot make use
              of the UID mapping information held on the server.




              Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)






              share|improve this answer




























                3












                3








                3







                Try:



                find /etc -type f -readable


                From man find:




                -readable

                Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
                -perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
                UID mapping (or root-squashing), since many systems implement
                access(2) in the client's kernel and so cannot make use
                of the UID mapping information held on the server.




                Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)






                share|improve this answer















                Try:



                find /etc -type f -readable


                From man find:




                -readable

                Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
                -perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
                UID mapping (or root-squashing), since many systems implement
                access(2) in the client's kernel and so cannot make use
                of the UID mapping information held on the server.




                Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited yesterday

























                answered yesterday









                John1024John1024

                48.5k5113128




                48.5k5113128






















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










                    draft saved

                    draft discarded


















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













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












                    RowanStone 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%2f511324%2ffind-all-files-a-user-can-read-from%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

                    Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                    Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                    Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...