加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-13 18:37:38 所属栏目:Linux 来源:网络整理
导读:我的用户bob无法访问他(理论上拥有)的文件.我正在运行Fedora Core 8.它可能比告诉我更容易显示: ls -al .total 32drwxrwxr-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
我的用户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是否相同.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读