Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a machine running Ubuntu 12.04 server with transmission-daemon running to handle bitorrents. Everything works fine except the transmission-daemon creates files as the user/group, debian-transmission, and with 744 file permissions.

  • I would like to be able to delete and move these file from a samba share.

  • I considered changing the primary group of the user debian-transmission, but I was worried that might mess up access to other files.

  • I thought it would be better to change the default permission of new files created by debian-transmission to 774, and add myself to the group debian-transmission.

    I know that this can be done with a umask, but my understanding is that this would be set in the .profile file and since debian-transmission has no home folder I wan't sure if that file existed for the user. So how to I accomplish this?

    Suggestions or alternate solutions are welcome. Thanks in advance.

share|improve this question
Did that on Crystalubuntu, now I get error when starting transmission - "unable to set gid to 113 (Operation not permitted)". Any idea? – user258783 Mar 16 '14 at 11:16
I ended up with following as crontab entry <pre> #!/bin/sh trap "" 1 logfile=/dev/null exec > $logfile 2>&1 set -x while true; do a="$(inotifywait -q -r -e move -e create -e delete /data/completeddownloads/Movies --format %w%f)" chown -R nobody:nobody "$a" done </pre> – user263229 Mar 29 '14 at 10:10
up vote 25 down vote accepted

You can specify a umask in transmission's config file (/etc/transmission-daemon/settings.json). Umask we normally represent in octal, but unfortunately, json does not support that, so we have to convert it to base 10. You can do this in the shell like this:

$ echo $(( 8#022 ))

That's the default, but you probably want 002, which is the same in decimal, so

sudo editor /etc/transmission-daemon/settings.json
# change "umask": 18 to "umask": 2 and save
sudo reload transmission-daemon # tells transmission-daemon to re-read the config 
                                # file. This is important, otherwise, the changes
                                # will be lost

Another thing. If you change the group ownership of the download dir, and add the setgid bit on it, all files created in that directory will have the same group ownership as that directory.

sudo chgrp "$USER" /path/to/transmission/download/dir
sudo chmod g+s /path/to/transmission/download/dir

It will not affect files that already exist. See for more.

share|improve this answer
Exactly what I needed. Thanks for including the setgid bit info, I forgot about those extra bits. – jpetersen Jun 29 '12 at 16:10

Try this:

mkdir /your_path/progress
mkdir /your_path/completed
sudo usermod -a -G debian-transmission your_user
chgrp debian-transmission /your_path/progress
chgrp debian-transmission /your_path/completed
chmod 770 /your_path/progress
chmod 770 /your_path/completed
sudo service transmission-daemon stop
sudo adduser your_user debian-transmission
sudo nano /etc/init.d/transmission-daemon
sudo chown your_user -R /var/lib/transmission-daemon/info/
sudo chown your_user -R /your_path/progress
sudo chown your_user -R /your_path/completed
sudo chown your_user -R /etc/transmission-daemon/settings.json

And change in the file: sudo nano /etc/transmission-daemon/settings.json

"rpc-whitelist": "" > "rpc-whitelist": "*.*.*.*",
"rpc-password": "password" > "rpc-password": "your_password",
"download-dir": "/var/lib/transmission-daemon/downloads" > "download-dir": "/your_path/completed"
"incomplete-dir": "/var/lib/transmission-daemon/downloads" > "incomplete-dir": "/your_path/progress"

Just restart the daemon:

service transmission-daemon start
share|improve this answer

protected by Community Mar 29 '14 at 10:40

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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