微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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.jb51.cc/linux/402460.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐