www-data访问sshfs挂载点

我在Debian Linux上有一个Apache2 。 我将sshfs挂载到目录/mnt/mountpoint/ (它通过/etc/fstab挂载在启动时)。 它通过/var/www/mountpoint的软链接访问。

当我用浏览器访问目录时,我得到一个403。

正如我所看到的用户www-data无法读取目录。

ls输出为www-data

 d????????? ? ? ? ? ? mountpoint 

root身份输出ls

 drwxrwxrwx 1 aneuschitzer www-data 4.0K Jun 5 16:27 

我在/etc/fstab相应行

 sshfs#reader@targethost:/mnt/mountpoint /mnt/mountpoint fuse ro,noexec,gid=www-data 0 0 

首先我有选项ro,noexec ,我尝试没有noexec 。 我读过如何设置sshfs来使用万维网数据,并尝试添加gid,但它没有帮助。

您需要在allow_other启用选项allow_other和/或/etc/fuse.conf 。 否则只有安装文件系统的用户才能使用它。 一旦你做出改变,卸载并重新安装文件系统。