# du cannot read directory permission denied

**URL:** <https://forums.suse.com/t/du-cannot-read-directory-permission-denied/29883>\
**Category:** SLES for System Z\
**Created:** [June 7, 2017, 4:20pm UTC](https://forums.suse.com/t/du-cannot-read-directory-permission-denied/29883 "2017-06-07T16:20:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikenash](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mikenash](https://forums.suse.com/u/mikenash)\
**Post date:** [June 7, 2017, 4:20pm UTC](https://forums.suse.com/t/du-cannot-read-directory-permission-denied/29883/1 "2017-06-07T16:20:04Z")

</div>

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

`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!

`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?

---

<div class="post-metadata">

**Author:** ![mikenash](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mikenash](https://forums.suse.com/u/mikenash)\
**Post date:** [June 7, 2017, 8:46pm UTC](https://forums.suse.com/t/du-cannot-read-directory-permission-denied/29883/2 "2017-06-07T20:46:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mikenash](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mikenash](https://forums.suse.com/u/mikenash)\
**Post date:** [June 7, 2017, 9:18pm UTC](https://forums.suse.com/t/du-cannot-read-directory-permission-denied/29883/3 "2017-06-07T21:18:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [June 12, 2017, 2:37pm UTC](https://forums.suse.com/t/du-cannot-read-directory-permission-denied/29883/4 "2017-06-12T14:37:59Z")

</div>

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
