Results 1 to 4 of 4

Thread: du cannot read directory permission denied

Hybrid View

  1. #1
    Join Date
    Nov 2014
    Location
    Pleasant Valley, New York 12569
    Posts
    167

    du cannot read directory permission denied

    I am executing the du command and I am receiving permission denied on some directories.

    Code:
    linux158:/usr/IBMi/depo/tools/rpm # ls -l
    total 8
    drwxr-xr-x 2 root root 4096 Sep 15  2008 aix
    drwx------ 2 root root 4096 May 16  2008 src
    linux158:/usr/IBMi/depo/tools/rpm # du src
    du: cannot read directory src: Permission denied
    4       src
    On another system I created a test with a directory having the same permissions but the su command worked!
    Code:
    root@linux140:/root #~>cd /mnt/
    Wed Jun 07 2017 09:16 AM
    root@linux140:/mnt #~>mkdir test
    Wed Jun 07 2017 09:16 AM
    root@linux140:/mnt #~>chmod 700 test
    Wed Jun 07 2017 09:16 AM
    root@linux140:/mnt #~>vi test/test
    Wed Jun 07 2017 09:17 AM
    root@linux140:/mnt #~>ls -l
    total 0
    drwx------ 2 root root 18 Jun  7 09:17 test
    Wed Jun 07 2017 09:17 AM
    root@linux140:/mnt #~>du test
    4       test
    Are there any suggestions to explain this problem?

  2. #2
    Join Date
    Nov 2014
    Location
    Pleasant Valley, New York 12569
    Posts
    167

    Re: du cannot read directory permission denied

    More information. I found that this directory is part of an auto mount file system. I find that I am allowed access to the /usr/IBMi/depo/tools/rpm/aix directory but not the
    /usr/IBMi/depo/tools/rpm/src directory. What would configuration creates this scenario? How would I verify this?

  3. #3
    Join Date
    Nov 2014
    Location
    Pleasant Valley, New York 12569
    Posts
    167

    Re: du cannot read directory permission denied

    I think I may understand what is happening.
    The user id. "root" on linux158 is not the user id. of the other system where this is mounted from.

  4. Re: du cannot read directory permission denied

    Hi Mike,

    > The user id. "root" on linux158 is not the user id. of the other system where this is mounted from.

    yes, indeed - typically, you'll map the client user "root" to i.e. "nobody" or some other unprivileged user on the NFS server side ("root_squash" option, see "man 5 exports"). This is to protect the file system exported by the server - as the server admin, you cannot guaranteed that the "root" account at the NFS client is safe.

    Regards,
    J
    From the times when today's "old school" was "new school"

    If you find this post helpful and are logged into the web interface, show your appreciation and click on the star below...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •