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

linux – 用户可以读取的目录,但root不能?

我的homedir下面有一个名为“.gvfs”的目录.作为我的常规用户帐户,我可以读得很好:
~ $ls -lart ~raldi/.gvfs
total 4
dr-x------  2 raldi raldi    0 2009-05-25 22:17 .
drwxr-xr-x 60 raldi raldi 4096 2009-05-25 23:08 ..
~ $ls -d ~raldi/.gvfs
dr-x------ 2 raldi raldi 0 2009-05-25 22:17 /home/raldi/.gvfs

但是,作为root我不能“ls”甚至“ls -d”它:

# ls ~raldi/.gvfs
ls: cannot access /home/raldi/.gvfs: Permission denied
# ls -d ~raldi/.gvfs
ls: cannot access /home/raldi/.gvfs: Permission denied

而且,只是为了确保:

# echo $UID $EUID
0 0

这只是Ubuntu 8.10的简单家庭安装,没有NFS或任何奇怪的东西.我看到该目录被标记为非世界可读(并且非world-x-able),但我认为当你是root用户时,这些都不适用.例如,我可以在/ tmp中创建一个mode-000目录并将其交给非root用户,root用户可以轻松阅读,编写它,无论如何.

知道发生了什么事吗?

解决方法

来自: http://bugzilla.gnome.org/show_bug.cgi?id=534284

This is all unfortunate,but its a
decision that has been taken by the
fuse people at the kernel level (user
others than the one who mounted the fs
can’t access it,including root) and
there is nothing we can do about it.

另见:https://bugs.launchpad.net/gvfs/+bug/225361

解决方案似乎是更新您的/etc/fuse.conf并启用user_allow_other选项.您可能还需要获取gvfs以传递allow_root或allow_other,但我不知道如何执行此操作.

当然,简单地放弃所有GUI工具(如gvfs)并从命令行安装文件系统可能要容易得多,在命令行中您可以完全控制某些内容的安装方式.

原文地址:https://www.jb51.cc/linux/401943.html

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

相关推荐