SSHFS and multi-user access

In a situation described in a previous post, i needed to setup apache with PHP files for being hosted in another machine, for the effect i used SSHFS to mount a remote directory in my Document Root over SSH, it uses Fuse and only requires a SSH server running in the target machine. So i wrote an init script to mount that directory before apache starts using a RSA SSH key for the login. But when i tried i always get an HTTP 403 permission denied error, checked and double checked for permissions, and everything was right. Ok, the problem is described here, since SSHFS uses Fuse, fuse doesn’t allow other users than the one who mounted the remote directory to have access to it.

You have two options:

  1. Confiure /etc/fuse.conf setting the user_allow_other option
  2. Mount your remote directory as the user who’s gonna access it (if it will be only one user, like www-data), you can do it with the sudo -u option. man sudo for more info.
About these ads
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: