[Solved] Can't get around "Permission Denied" in Transmission

I am running latest OSMC on Raspberry Pi 2. My folder permissions look as you can see above. I have a NTFS volume on a hard drive attached to the Pi 2 via USB. I tried everything I could think of and I am still running into Permission Denied errors. I edited the config file and the USER is set to osmc. I also tried user=root, no luck. What am I doing wrong here?

NAME=transmission-daemon
DAEMON=/usr/bin/$NAME
USER=osmc
STOP_TIMEOUT=30

This is how my /etc/init.d/transmission-daemon config looks like

Can you even write to the NTFS volume manually ?

Unless I’m mistaken NTFS support in LInux is read only unless you enable experimental (and not recommended) write support.

If OSMC uses ntfs-3g then write support should be available but if OSMC uses it i don’t know.

I am able to delete and rename files, so that seems to confirm write access to the drive.

Same issue here. I tried with ext4 volume after ntfs, but it not solved the problem. I will make further testing soon. If you have any idea, I can give you some outputs! Thank You!

1 Like

I don’t know if this makes a difference but I installed SAMBA server and I can access the drive just fine with full permissions.
Also, this is what my /etc/fstab file looks like.

/dev/mmcblk0p1 /boot vfat defaults,noatime 0 0
/dev/mmcblk0p2 / ext4 defaults,noatime 0 0

The drive in question has 2 partitions, both NTFS. One of them used to be my Windows 7 partition, which I have marked as inactive and hidden. It shouldn’t have anything to do with any of this.

Have you checked that transmission is actually running as the osmc user as instructed ?

Check in top or with

ps auxwf

Can you turn on any debugging options in transmission and then check it’s log file for more detailed errors ?

I took a snippet of the only spot I found the transmission-daemon listed. Does this indicate it is still running under the debian user? Why?

Hello,
I have noticed that I need to edit

/lib/systemd/system/transmission-daemon.service

and set the

User=osmc

in order to run the daemon as osmc user.

2 Likes

Amazing, jemoon! That fixed it! I also had to edit /etc/init.d/transmission-daemon. THANK YOU!

The following would also solve the problem without having to edit files:

sudo usermod -a -G osmc debian-transmission
2 Likes

The problem with doing this is if an update to transmission comes out or you uninstall or reinstall it your change will be wiped out as a new copy of transmission-daemon.service will be installed.

There are two ways you can handle this. One is to simply copy transmission-daemon.service to /etc/systemd/system/ and edit this copy of the file - it will always take precedence over the version in /lib/systemd/system, so even if that version gets changed by an upgrade your version of the file is still in effect.

Another way to do it is to override only the one line you need so that updates to transmission-daemon.service can still apply but your one change is always applied on top of it. To do that create the directory /etc/systemd/system/transmission-daemon.service.d/ and in that directory create local.conf.

In local.conf put only:

[Service]
User = osmc

This change will now always be merged on top of the settings in /lib/systemd/system/transmission-daemon.service - that way if they make important changes to other lines like ExecStart those changes will apply.

See Example 2: overriding vendor settings near the bottom of this page:

http://www.freedesktop.org/software/systemd/man/systemd.unit.html

4 Likes

Thank you gentlemen. To be on the safe/convenient side, I decided to just run sudo usermod -a -G osmc debian-transmission. I will keep all other suggested workarounds in mind and apply them as necessary.

Hi,

Did that solution work for you?

I did the same but i still can’t download any files to my download directory…

The transmission-daemon is being run by the default “debian-transmission” and I ran the command

sudo usermod -a -G osmc debian-transmission

as mentioned above.

Any idea what it could be?

Kind Regards.

1 Like

HDD mounted on /media won’t work with transmission or other apps which are no kodi related. You should mount it in other place. With this commands should be enough

umount /media/My\ Passport
sudo mkdir /mnt/HDD
sudo mount /dev/sda1 /mnt/HDD

You are incorrect, it works that way too. That’s how I have it set up. Transmission downloads to /Media/ mount.

Sandkiller, follow what jemoon said above. It worked for me.

I’ve done that and rebooted.

Still it’s not working and I’m not sure why…

I even configured it both ways:

osmc@osmc:/media/My Passport/Downloads$ groups osmc
osmc : osmc adm disk lp dialout cdrom audio video debian-transmission
osmc@osmc:/media/My Passport/Downloads$ groups debian-transmission
debian-transmission : debian-transmission osmc

I also tried what jemoon posted above and changed the users directly but for some reason was no longer able to access the webui (got a 403 error message).

Is your hdd mounted automatically by the system or did you specify anything specific in fstab?

EDIT:

It finally worked! It seems like osmc is auto-mounting the HDD with no group permissions.
I added a line to /etc/fstab to automatically mount it with rw permissions for the group:

/dev/sda1 /media/My\040Passport ntfs-3g defaults,auto,uid=1000,gid=1000,umask=002 0 0
1 Like