为什么root访问FUSE目录时权限被拒绝?

yon*_*ran 29 permissions fuse

我使用 FUSE 文件系统作为我自己的用户没有问题,但 root 无法访问我的 FUSE 安装。相反,任何命令都会给出Permission denied. 如何授予 root 读取这些挂载的权限?

~/top$ sudo ls -l
total 12
drwxr-xr-x 2 yonran yonran 4096 2011-07-25 18:50 bar
drwxr-xr-x 2 yonran yonran 4096 2011-07-25 18:50 foo
drwxr-xr-x 2 yonran yonran 4096 2011-07-25 18:50 normal-directory
~/top$ fuse-zip foo.zip foo
~/top$ unionfs-fuse ~/Pictures bar
Run Code Online (Sandbox Code Playgroud)

我的用户yonran可以很好地阅读:

~/top$ ls -l
total 8
drwxr-xr-x 1 yonran yonran 4096 2011-07-25 18:12 bar
drwxr-xr-x 2 yonran yonran    0 2011-07-25 18:51 foo
drwxr-xr-x 2 yonran yonran 4096 2011-07-25 18:50 normal-directory
~/top$ ls bar/
Photos
Run Code Online (Sandbox Code Playgroud)

但是root不能读取 FUSE 目录:

~/top$ sudo ls -l
ls: cannot access foo: Permission denied
ls: cannot access bar: Permission denied
total 4
d????????? ? ?      ?         ?                ? bar
d????????? ? ?      ?         ?                ? foo
drwxr-xr-x 2 yonran yonran 4096 2011-07-25 18:50 normal-directory
~/top$ sudo ls bar/
ls: cannot access bar/: Permission denied
Run Code Online (Sandbox Code Playgroud)

我正在运行 Ubuntu 10.04:我总是从 Canonical 安装任何更新。

$ uname -a
Linux mochi 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:13:52 UTC 2011 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 10.04.3 LTS
Release:    10.04
Codename:   lucid
Run Code Online (Sandbox Code Playgroud)

编辑:删除了 root 过去能够访问安装的含义。想想看,也许我的脚本从未尝试以 root 身份访问该目录。

tux*_*xce 28

这是工作的方式fuse。如果要允许访问 root 或其他用户,则必须添加:

user_allow_other
Run Code Online (Sandbox Code Playgroud)

在 /etc/fuse.conf 中并使用allow_otherallow_root作为选项挂载您的保险丝文件系统。

  • 我是唯一一个读过这篇文章但仍然不知道该做什么的人吗?allow_other 进入 /etc/fstab?别的地方? (7认同)
  • @felipeek我知道这是两年后的事了,但对于任何刚刚遇到这个问题的人来说:它是 echo "user_allow_other" >> /etc/fuse.conf。如果文件中已有内容,您不想覆盖该文件。 (3认同)