linux – 对我拥有的文件’权限被拒绝’?

前端之家收集整理的这篇文章主要介绍了linux – 对我拥有的文件’权限被拒绝’?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我的用户bob无法访问他(理论上拥有)的文件.我正在运行Fedora Core 8.它可能比告诉我更容易显示
> ls -al .
total 32
drwxrwxr-x 7 bob bob 4096 May 18 14:33 .
drwxrwxr-x 4 bob bob 4096 May 12 15:44 ..
drwxr-xr-x 2 bob bob 4096 June 1 14:22 log

> cd ./log
-bash: cd: log/: Permission denied

> ls -al ./log
ls: cannot access log/..: Permission denied
ls: cannot access log/the.log: Permission denied
ls: cannot access log/.: Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
-????????? ? ? ? ?            ? the.log

> sudo ls -al ./log
drw-rw-r-- 3 bob bob      4096 Jun  2 04:11 .
drwxrwxr-x 7 bob bob      4096 May 18 14:33 ..
-rw-rw-r-- 1 bob bob         0 Jun  1 04:12 the.log

ls -al非常奇怪.它会列出我没有权限看的文件,但是没有显示权限?

所以问题是,这会导致什么?我该怎么做才能修复它?

解决方法

> sudo ls -al ./log
...
drw-rw-r-- 3 bob bob      4096 Jun  2 04:11 .

它看起来不像Bob有./log的执行权限,所以他不能cd到它.

> ls -al .
...
drwxr-xr-x 2 bob bob 4096 June 1 14:22 log

表明他做到了.但它看起来并不像是指向同一个文件(不同的权限,不同的modtime).

尝试使用sudo ls -ail ./log和ls -ail来查看inode是否相同.

原文链接:https://www.f2er.com/linux/402460.html

猜你在找的Linux相关文章