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

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

1 Answer 1

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

4
  • Please what's the X for thought it should be x ? Jan 3, 2017 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, 2017 at 6:34
  • I also thought setfacl user only affects files not folders and setfacl group did. Jan 3, 2017 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, 2017 at 6:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .