Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI was under the impression that unless you have execute permission for a directory, you can't search that dir or do a cd to it.
But I tried removing execute permission for a directory, and I can still go into that dir. Then, what is the real use for execute permission for directories?
# mkdir 开发者_JAVA技巧tmp
# ll
total 4
drwxr-xr-x 2 root root 4096 Jul 13 13:52 tmp
# chmod 0600 tmp
# ll
total 4
drw------- 2 root root 4096 Jul 13 13:52 tmp
# cd tmp/
You are running as root. root can ignore permissions.
If you want to test out permissions, test using a non-root user.
If you are accessing the directories on a server, the administrator can set permissions for a user.
精彩评论