Ubuntu – Give permission to debian-transmission to write into a www-data directory


I want the transmission-daemon to have permission to write to a directory called /opt/www/ that already has the owner set to www-data(in order for the web server to serve files in it)

The transmission daemon responds with a permission denied error when I set it to my download directory. How can I give it permission to write in this directory while maintaining the www-data ownership?

Sorry if it's a bit confusing I will clarify if I was unclear.

Basically: /opt/www needs www-data to be able to be served as a webpage, but at the same time I want transmission to be able to write files to that folder. How can I do that? By default transmission runs on the user debian-transmission

Best Answer

Give debian-transmission write permission on the directory using ACLs:

sudo setfacl -Rm u:debian-transmission:rwX /opt/www
sudo setfacl -Rdm u:debian-transmission:rwX /opt/www

This sets both the current permissions and default permissions (ones inherited by new files/folders).

Related Question