0

I have made an sshfs mount as follows (33 is the uid of the www-data). Listing the folders and files shows them as having read and execute access for www-data. But when my application running as www-data tries to access the mount I get a permission error.

/etc/fstab

example.com:/remote/folder/ /local/folder fuse.sshfs ro,uid=33,gid=33 0 0

I get the same permission error if I do the following:

sudo -u www-data python
>>> import os
>>> os.listdir('/local/folder')
lofidevops
  • 3,159

1 Answers1

4

You need to add the allow_other permission to your sshfs mount declaration. Otherwise only the user who performs the mount can access it, even if the file permissions are correct.

/etc/fstab

example.com:/remote/folder/ /local/folder fuse.sshfs ro,uid=33,gid=33,allow_other 0 0

Source: sshfs mount, sudo gets permission denied
(similar issue with root instead of www-data)

lofidevops
  • 3,159