34

I installed Xubuntu and transmission daemon, set the download path to my home/user/TV shows, and get a permission denied when trying to download torrents through the transmission.

I tried chmod -r 777 on this folder without success.

Please help!

Following is the output of ps -ef | grep transmission

chen@htpc:~$ ps -ef | grep transmission
109       1023     1  1 21:46 ?        00:00:35 /usr/bin/transmission-daemon --config-dir /var/lib/transmission-daemon/info

chen@htpc:~$ ps aux | grep transmission
109       1023  3.2  0.4  47684 16620 ?        Ssl  21:46   1:20     /usr/bin/transmission-daemon --config-dir /var/lib/transmission-daemon/info
chen      1852  0.0  0.0   4200   772 pts/0    S+   22:27   0:00 grep --color=auto transmission

enter code here
6
  • Can you add the output of ps -ef | grep transmission to the question. I don't think transmission-daemon has the right to write to home dirs by default. Nov 23, 2012 at 20:09
  • I added it, how do I add permissions to this user ? Nov 23, 2012 at 20:18
  • Well, I was after the name of the user it runs under, but it's not shown. Try ps aux | grep transmission instead. Nov 23, 2012 at 20:25
  • Hm..., it looks like its username it 109 - kind of odd. Nov 23, 2012 at 20:39
  • This is really bizarre, but it should be running under debian-transmission, not sure why it shows a stupid number. You can verify that with id debian-transmission. Nov 23, 2012 at 20:46

20 Answers 20

71

Assuming the path to the download folder is /home/chen/TV shows, run the following:

  • add chen to the debian-transmission group

    sudo usermod -a -G debian-transmission chen
    
  • change the folder ownership

    sudo chgrp debian-transmission /home/chen/TV\ shows
    
  • grant write access to the group

    sudo chmod 770 /home/chen/TV\ shows
    
  • Stop the deamon with

    sudo service transmission-daemon stop
    
  • The last thing to do is change the file creation mask, so that the downloaded files would be writeable by chen.

    sudo nano /etc/transmission-daemon/settings.json
    

    … and change "umask": 18 to "umask": 2. Hit Ctrl+O to save and Ctrl+X to exit.

Start the daemon with

sudo service transmission-daemon start
8
  • 1
    In case anyone tries to cd into their directory right after doing this and receive a permission denied, logout and login again. My SSH session did not have the right permissions to access the folder after folder ownership was given to debian-tranmission group (since my user wasn't added to that group until next logon) Aug 11, 2015 at 6:37
  • This works up until I need to create a new folder (e.g. the torrent's files are nested). Then I get another permission denied.
    – GDorn
    Mar 21, 2016 at 19:00
  • @GDorn That shouldn't be the case. "umask": 2 translates to permissions of 774, or rwxrwxr--, which means fool access for owner and group. Mar 21, 2016 at 19:17
  • Useful answer, but, maybe, I can suggest an editt to the answer: I had troubles with /var/lib/transmission-daemon/.config/transmission-demon/torrents. This directory didn't have write permission. Changing them all stated to work.
    – LPs
    Dec 30, 2016 at 22:09
  • 1
    @GDorn you can use chmod -R to make the command recursive May 3, 2020 at 22:22
9

Check if you're using an "incomplete" folder. The error can be misleading in this case and it may be the incomplete folder you do not have write access to.

4
  • 4
    that was my case: in the settings I had a wrong case for the incomplete dir. So the error was doubly misleading: the error was not in the directory the error was telling and the error should have been "not found" and not "permission denied" Aug 1, 2016 at 9:05
  • 2
    This was my problem! It had reset to /root/incomplete, which obviously isn't writable!
    – Pez Cuckow
    Apr 30, 2018 at 17:27
  • 1
    What @RiccardoCossu said. Can't upvote enough.
    – rocketboy
    May 1, 2018 at 13:32
  • Same problem here. There was a folder called 'downloads' but settings.json was referring to 'Downloads'.
    – btzs
    Jan 22, 2022 at 1:45
7

This is a permission issue based on the user ID that is running Transmission. Transmission sets up a default user that you might not expect on first install. The user name is debian-transmission.

I will explain how to change that:

  1. Stop the Transmission daemon sudo service transmission-daemon stop
  2. Open the Transmission config file for editing: sudo nano /etc/init.d/transmission-daemon
  3. Find the line that says USER=debian-transmission and change it to the user that owns the folder in question. If you are not concerned about security issues, you can also use USER=root in this file. (Not advised, but good for troubleshooting).
  4. Alternatively (instead of point number 3), modify the /etc/fstab folder to mount the folder with correct permissions for the user that runs the transmission-daemon.
  5. Start the Transmission daemon sudo service transmission-daemon start
2
  • 2
    That won't work. Here either the user transmission-daemon or root also owns "/var/lib/transmission-daemon/info/settings.json" and if you change the daemon to run as $USER , it will give Couldn't read "/var/lib/transmission-daemon/info/settings.json": Permission denied. It somehow worked in your system , But this is not the proper way to do it. Mar 15, 2016 at 10:15
  • 1
    It works, thanks. And if your using systemd you should edit the User under [Service] at /lib/systemd/system/transmission-daemon.service.
    – zer09
    Nov 23, 2019 at 10:09
2

Since this is the top search result in Google, for anyone reading this, I spend over an hour trying to get it to work. Turns out, the downloads folder specified in settings.json is "Downloads" instead of "downloads". Note the case.

1

This might be an apparmor profile problem. Transmission runs under the sanitized_helper profile in apparmor.

Look for complaints in /var/log/kern.log. grep transm /var/log/kern.log, particularly just after trying to run transmission and it failing.

1

This just happened to me. I found this page, was intimidated by all the jargon, so I restarted Transmission, reserved the torrent file to a different location, and saved the torrent data to the same different location (desktop). Worked like a charm...

1

my problem was that transmission somehow was running as the user "transmissions-daemon" instead of the user it was supposed to run with.

1
  • How did you fix this? I have same problem.
    – chovy
    Dec 30, 2022 at 2:39
0

In my case the problem was how the drive was being mounted. Using this in /etc/fstab worked for me:

UUID=2069-1A05  /mnt/ext   vfat   rw,user,exec,umask=0000   0   0
1
  • 1
    A bit of context might help here (vfat? Not a typical Linux filesystem) - what was your scenario, what exactly was not working and how did this fix it?
    – Zanna
    Jan 2, 2017 at 21:37
0

Make sure that the path for your incomplete torrents is absolute. My main directory was using ~/path-to-download, which gave me an error. My incomplete directory was ~/path-to-download/incomplete.

I received an error the first time I tried to download a torrent not using an absolute directory. I fixed that, but kept receiving a permission denied error, even after adding the correct permissions. Once I fixed my incomplete path to an absolute path, everything worked.

0

Mounting the external drive into my home directory resolved this issue;

sudo mkdir /home/plex/media-server
sudo chmod 770 /home/plex/media-server
sudo mount /dev/sdxx/ /home/plex/media-drive

sdxx is the name of your hdd. you can use the following command to find yours:

lsblk
0

Try this:

sudo setfacl -m u:debian-transmission:rxw  /home/*your user*/*your path to folder*
1
  • 1
    Welcome to Ask Ubuntu! If you edit this and add a little more explanation on what this command does and how to undo it if it does not work, it would be more helpful.
    – guttermonk
    Sep 20, 2020 at 16:19
0

None of these suggestions worked for me so I just set fstab to use transmission-daemon's default download directory as the mountpoint to mount my USB stick.

  1. First I set the ownership of my USB stick to match that of the default download directory:

sudo chown debian-transmission:debian-transmission /media/pi/[mountpoint]/

  1. Edit fstab:

sudo nano /etc/fstab

Insert the following text:

UUID=[insert device UUID here] /var/lib/transmission-daemon/downloads ext4 rw,user,exec 0 0

Note: you can find your USB sticks UUID by running sudo blkid

  1. Reboot the system:

sudo reboot

  1. You can test whether it is writing data to your USB stick by running df -ha and checking whether the data written to your USB stick increases when you add a new torrent. Note that the data increase happens all at once when you add a new torrent and NOT gradually as the torrent downloads.
0
0

I added the debian-transmission user to my $USER group:

sudo usermod -a -G <myusername> debian-transmission
0

In my case I have the "download-dir", "incomplete-dir" (and "watch-dir") situated in my home-directory.

(presume my userid is '[user]')

ls -la /home/[user]/Transmission results in:

drwxr-xr-x  5 [user] debian-transmission 4096 sep 17 21:21 ./
drwxr-x--- 19 [user] [user]              4096 sep 20 20:08 ../
drwxrwxr-x  3 [user] debian-transmission 4096 sep 18 23:04 Completed/
drwxrwxr-x  4 [user] debian-transmission 4096 sep 20 20:11 Incomplete/
drwxrwxr-x  2 [user] debian-transmission 4096 sep 17 21:21 Torrents/

As you can see the user debian-transmission has all the necessary permissions to write in those directories except... it has no read and execute permission on /home/[user] !!! So as a result, debian-transmission cannot access its subdirectories either.

  • Lesson learned: check the permissions for the entire path ! Not just the final target directory !

There are now 3 options (choose one !):

  1. Add the group [user] to the user debian-transmission (sudo usermod -a -G [user] debian-transmission)
  2. Set x-permissions on world for /home/[user] (sudo chmod o+x /home/[user])
  3. Stop the deamon, move the whole directory tree /home/[user]/Transmission to the home directory of debian-transmission. Set ownership of those directories to debian-transmission:debian-transmission. Edit /etc/transmission-daemon/settings.json likewise. Add group debian-transmission to [user] and -finally- start the deamon again.

Option 1 and 2 have some minor security issues so option 3 is probably the best.

0

2022 and I had the same issue.

A simple sudo chown debian-transmission:debian-transmission -R /path/to/download solved it for me.

0

For those with custom locations, be sure you are applying chown to the original folder path and not a symlink.

sudo chown -R debian-transmission:debian-transmission /mnt/nas/downloads

NOT

sudo chown -R debian-transmission:debian-transmission /home/coolguy/nas/downloads

Add a 755

sudo chmod -R 755 /mnt/nas/downloads

I was able to get around the permissions issue by doing that. Also, no need to change the umask or 777 (or running as root, not a good plan).

Also, the latest transmission-daemon doesn't seem to include and error log. Add this to your config file if you need some error output for debugging:

"log-error-file": "/var/log/transmission-error.log"

Be sure to restart

systemctl restart transmission-daemon
0

I had the same issues, given my downloads folder is /home/user/media. After fixing the permissions of that particular folder so that the user debian-transmission could read and write (see accepted answer), it still did not work.

The reason was that my /home/user folder had incorrect permissions, to prevent other users from reading its content. To access a directory, a user must have execute permission on the parent folder. To fix that:

  1. Either set to standard home folder permissions. All users will be able to read inside it now.
chmod 755 /home/user
  1. Either add debian-transmission to your user group:
sudo usermod -a -G user debian-transmission
0

Try to disable this setting, so no temprorary files should be save & cause permissions issue:

enter image description here

-1

I had same issue, and that was a mistake I had made when sym-linking the transmission download directory to my home/user/ directory, I changed the ownership of the sym-linked file which by consequence also changed the ownership of the transmission 'download' directory...

I just chowned back to 'debian-transmission' ownership and it worked like a charm (without need to restart service)

#chown debian-transmission:debian-transmission /var/lib/transmission/downloads

(well, you'll have to check according your own linux distribution what is the right owner and eventually also your right path to the downloads directory)

-1

I had similar issue with transmission. I got Permission Error while downloading even with correct folder permission settings on the external USB HDD.

I just mounted the external HDD to the /home/pi/ with the same permissions and it worked fine.

mount /dev/sda /home/pi/USB-HDD-MOUNTED

permissions are drwxrwxrwx (0777) pi:debian-transmission. user name is changed to pi in /etc/init.d/transmisssion-daemon.

You must log in to answer this question.

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