2

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. Thanks!

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

  • You talk of two folders /opt/www and /home/username/Downloads could be more specific. – George Udosen Jan 3 '17 at 6:19
  • I attempted to clarify in my edit now @George – Chaos Jan 3 '17 at 6:22
3

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).

  • Please what's the X for thought it should be x ? – George Udosen Jan 3 '17 at 6:32
  • 2
    @George from man setfacl: "execute only if the file is a directory or already has execute permission for some user (X)". It's a better option than simply giving execute permissions (x). – muru Jan 3 '17 at 6:34
  • I also thought setfacl user only affects files not folders and setfacl group did. – George Udosen Jan 3 '17 at 6:34
  • 2
    @George you're thinking of setuid and setgid, which are a different concept. This is setting ACLs, and ACLs may include setuid/setgid permissions as well. – muru Jan 3 '17 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.