开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜