开发者

Is execute permission needed to cd to a directory in unix? [closed]

开发者 https://www.devze.com 2023-03-20 09:46 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消