I have mounted a remote share via my fstab using the line:
//path/to/target /media/f cifs gid=<mygroup's id>,dir_mode=0775,file_mode=0775 0 0
As a result, everything under
/media/f winds up with permissions that look like this:
$ ls -al drwxrwxr-x 0 root mygroup ...
I have made the user
www-data a member of
mygroup, with the goal of allowing a Django webapp to write files within
/media/f. However, it doesn't work. I get permission errors.
In an effort to fix the problem, I changed the mount line to set both the
uid so that the mount point has user
www-data and group
mygroup. So now my mount point looks like this:
$ ls -al drwxrwxr-x 0 www-data mygroup ...
And everything works fine.
The question: why is it that my webapp is able to write to
/media/f when the that folder is owned by
www-data:mygroup but not when it is owned by
root:mygroup (knowing that
www-data is a member of
I have tried remounting as well as restarting in the hopes of getting the membership of
www-data (the user) to the group
mygroup to "stick" but it just doesn't work.
Oddly, when set up with the
root:mygroup ownership, if I
sudo su www-data and then try to write to
/media/f from the terminal, everything works fine. Any idea what's going on there? It's as if the
uwsgi process that's running django isn't really running with the full permissions I've tried to grant to