How to list all the users that have access to a directory?












4















When I do ls -al, I see that "users" have access to a particular directory. How do I see what users have what access to these directories?



$ls -al
drwxrwxrwt 7 root root 4096 Mar 9 23:37 .
drwxr-xr-x 5 root root 4096 Feb 22 14:28 ..
drwxrwxrwx 65 myname users 4096 Feb 22 20:08 tools
-rwxr-xr-x 1 myname users 3832976 Jan 27 13:39 pfiles
drwxr-xr-x 2 myname users 4096 Jan 23 07:57 nfiles
drwxr-xr-x 4 myname users 4096 Aug 1 2014 dfiles









share|improve this question

























  • when you set the linux permissions like your example. Others can read/execute your directory.Because your linux permissions setting was rwx - rx -rx or 755.

    – supriady
    Mar 19 '17 at 8:39











  • to put a finer point on what supriady said, everyone that can log in to the system can see those files/directories (assuming they can get to the parent directory).

    – Jeff Schaller
    Feb 10 at 1:24
















4















When I do ls -al, I see that "users" have access to a particular directory. How do I see what users have what access to these directories?



$ls -al
drwxrwxrwt 7 root root 4096 Mar 9 23:37 .
drwxr-xr-x 5 root root 4096 Feb 22 14:28 ..
drwxrwxrwx 65 myname users 4096 Feb 22 20:08 tools
-rwxr-xr-x 1 myname users 3832976 Jan 27 13:39 pfiles
drwxr-xr-x 2 myname users 4096 Jan 23 07:57 nfiles
drwxr-xr-x 4 myname users 4096 Aug 1 2014 dfiles









share|improve this question

























  • when you set the linux permissions like your example. Others can read/execute your directory.Because your linux permissions setting was rwx - rx -rx or 755.

    – supriady
    Mar 19 '17 at 8:39











  • to put a finer point on what supriady said, everyone that can log in to the system can see those files/directories (assuming they can get to the parent directory).

    – Jeff Schaller
    Feb 10 at 1:24














4












4








4








When I do ls -al, I see that "users" have access to a particular directory. How do I see what users have what access to these directories?



$ls -al
drwxrwxrwt 7 root root 4096 Mar 9 23:37 .
drwxr-xr-x 5 root root 4096 Feb 22 14:28 ..
drwxrwxrwx 65 myname users 4096 Feb 22 20:08 tools
-rwxr-xr-x 1 myname users 3832976 Jan 27 13:39 pfiles
drwxr-xr-x 2 myname users 4096 Jan 23 07:57 nfiles
drwxr-xr-x 4 myname users 4096 Aug 1 2014 dfiles









share|improve this question
















When I do ls -al, I see that "users" have access to a particular directory. How do I see what users have what access to these directories?



$ls -al
drwxrwxrwt 7 root root 4096 Mar 9 23:37 .
drwxr-xr-x 5 root root 4096 Feb 22 14:28 ..
drwxrwxrwx 65 myname users 4096 Feb 22 20:08 tools
-rwxr-xr-x 1 myname users 3832976 Jan 27 13:39 pfiles
drwxr-xr-x 2 myname users 4096 Jan 23 07:57 nfiles
drwxr-xr-x 4 myname users 4096 Aug 1 2014 dfiles






linux permissions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 15 '18 at 16:38









Rui F Ribeiro

40.4k1479137




40.4k1479137










asked Mar 19 '17 at 8:25









ajyajy

13113




13113













  • when you set the linux permissions like your example. Others can read/execute your directory.Because your linux permissions setting was rwx - rx -rx or 755.

    – supriady
    Mar 19 '17 at 8:39











  • to put a finer point on what supriady said, everyone that can log in to the system can see those files/directories (assuming they can get to the parent directory).

    – Jeff Schaller
    Feb 10 at 1:24



















  • when you set the linux permissions like your example. Others can read/execute your directory.Because your linux permissions setting was rwx - rx -rx or 755.

    – supriady
    Mar 19 '17 at 8:39











  • to put a finer point on what supriady said, everyone that can log in to the system can see those files/directories (assuming they can get to the parent directory).

    – Jeff Schaller
    Feb 10 at 1:24

















when you set the linux permissions like your example. Others can read/execute your directory.Because your linux permissions setting was rwx - rx -rx or 755.

– supriady
Mar 19 '17 at 8:39





when you set the linux permissions like your example. Others can read/execute your directory.Because your linux permissions setting was rwx - rx -rx or 755.

– supriady
Mar 19 '17 at 8:39













to put a finer point on what supriady said, everyone that can log in to the system can see those files/directories (assuming they can get to the parent directory).

– Jeff Schaller
Feb 10 at 1:24





to put a finer point on what supriady said, everyone that can log in to the system can see those files/directories (assuming they can get to the parent directory).

– Jeff Schaller
Feb 10 at 1:24










2 Answers
2






active

oldest

votes


















2














users is a group, so the members of that group and all of the other groups is available in /etc/group.



The ArchWiki has an excellent page on file permissions and attributes.






share|improve this answer


























  • Group users is not in the file. cat /etc/group | grep users doesn't return anything. Any idea why?

    – ajy
    Mar 19 '17 at 8:44











  • Strange, "users" should be an invalid group, then, and the GID would be shown instead of the name. Which distribution are you on?

    – Kenneth B. Jensen
    Mar 19 '17 at 8:52











  • Only non-primary group memberships are listed in group (but users should still be in it).

    – Michael Homer
    Mar 19 '17 at 9:07






  • 1





    the group entries could be in elsewhere, such as NIS or LDAP; use getent group users as Tagar did

    – Jeff Schaller
    Feb 10 at 1:23



















2














To get list of users in users group, you could use following command:



$ getent group users
users:x:1021:ken,ben,dan





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%2f352415%2fhow-to-list-all-the-users-that-have-access-to-a-directory%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    users is a group, so the members of that group and all of the other groups is available in /etc/group.



    The ArchWiki has an excellent page on file permissions and attributes.






    share|improve this answer


























    • Group users is not in the file. cat /etc/group | grep users doesn't return anything. Any idea why?

      – ajy
      Mar 19 '17 at 8:44











    • Strange, "users" should be an invalid group, then, and the GID would be shown instead of the name. Which distribution are you on?

      – Kenneth B. Jensen
      Mar 19 '17 at 8:52











    • Only non-primary group memberships are listed in group (but users should still be in it).

      – Michael Homer
      Mar 19 '17 at 9:07






    • 1





      the group entries could be in elsewhere, such as NIS or LDAP; use getent group users as Tagar did

      – Jeff Schaller
      Feb 10 at 1:23
















    2














    users is a group, so the members of that group and all of the other groups is available in /etc/group.



    The ArchWiki has an excellent page on file permissions and attributes.






    share|improve this answer


























    • Group users is not in the file. cat /etc/group | grep users doesn't return anything. Any idea why?

      – ajy
      Mar 19 '17 at 8:44











    • Strange, "users" should be an invalid group, then, and the GID would be shown instead of the name. Which distribution are you on?

      – Kenneth B. Jensen
      Mar 19 '17 at 8:52











    • Only non-primary group memberships are listed in group (but users should still be in it).

      – Michael Homer
      Mar 19 '17 at 9:07






    • 1





      the group entries could be in elsewhere, such as NIS or LDAP; use getent group users as Tagar did

      – Jeff Schaller
      Feb 10 at 1:23














    2












    2








    2







    users is a group, so the members of that group and all of the other groups is available in /etc/group.



    The ArchWiki has an excellent page on file permissions and attributes.






    share|improve this answer















    users is a group, so the members of that group and all of the other groups is available in /etc/group.



    The ArchWiki has an excellent page on file permissions and attributes.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 19 '17 at 16:02









    Pro Backup

    2,09363258




    2,09363258










    answered Mar 19 '17 at 8:29









    Kenneth B. JensenKenneth B. Jensen

    57839




    57839













    • Group users is not in the file. cat /etc/group | grep users doesn't return anything. Any idea why?

      – ajy
      Mar 19 '17 at 8:44











    • Strange, "users" should be an invalid group, then, and the GID would be shown instead of the name. Which distribution are you on?

      – Kenneth B. Jensen
      Mar 19 '17 at 8:52











    • Only non-primary group memberships are listed in group (but users should still be in it).

      – Michael Homer
      Mar 19 '17 at 9:07






    • 1





      the group entries could be in elsewhere, such as NIS or LDAP; use getent group users as Tagar did

      – Jeff Schaller
      Feb 10 at 1:23



















    • Group users is not in the file. cat /etc/group | grep users doesn't return anything. Any idea why?

      – ajy
      Mar 19 '17 at 8:44











    • Strange, "users" should be an invalid group, then, and the GID would be shown instead of the name. Which distribution are you on?

      – Kenneth B. Jensen
      Mar 19 '17 at 8:52











    • Only non-primary group memberships are listed in group (but users should still be in it).

      – Michael Homer
      Mar 19 '17 at 9:07






    • 1





      the group entries could be in elsewhere, such as NIS or LDAP; use getent group users as Tagar did

      – Jeff Schaller
      Feb 10 at 1:23

















    Group users is not in the file. cat /etc/group | grep users doesn't return anything. Any idea why?

    – ajy
    Mar 19 '17 at 8:44





    Group users is not in the file. cat /etc/group | grep users doesn't return anything. Any idea why?

    – ajy
    Mar 19 '17 at 8:44













    Strange, "users" should be an invalid group, then, and the GID would be shown instead of the name. Which distribution are you on?

    – Kenneth B. Jensen
    Mar 19 '17 at 8:52





    Strange, "users" should be an invalid group, then, and the GID would be shown instead of the name. Which distribution are you on?

    – Kenneth B. Jensen
    Mar 19 '17 at 8:52













    Only non-primary group memberships are listed in group (but users should still be in it).

    – Michael Homer
    Mar 19 '17 at 9:07





    Only non-primary group memberships are listed in group (but users should still be in it).

    – Michael Homer
    Mar 19 '17 at 9:07




    1




    1





    the group entries could be in elsewhere, such as NIS or LDAP; use getent group users as Tagar did

    – Jeff Schaller
    Feb 10 at 1:23





    the group entries could be in elsewhere, such as NIS or LDAP; use getent group users as Tagar did

    – Jeff Schaller
    Feb 10 at 1:23













    2














    To get list of users in users group, you could use following command:



    $ getent group users
    users:x:1021:ken,ben,dan





    share|improve this answer




























      2














      To get list of users in users group, you could use following command:



      $ getent group users
      users:x:1021:ken,ben,dan





      share|improve this answer


























        2












        2








        2







        To get list of users in users group, you could use following command:



        $ getent group users
        users:x:1021:ken,ben,dan





        share|improve this answer













        To get list of users in users group, you could use following command:



        $ getent group users
        users:x:1021:ken,ben,dan






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 9 at 20:48









        TagarTagar

        1786




        1786






























            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%2f352415%2fhow-to-list-all-the-users-that-have-access-to-a-directory%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

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            Touch on Surface Book