23

I have a general question about the UNIX world.

I am currently running Ubuntu at home and installed Transmission on a device and it runs as and saves files as the transmission-debian user. I am wondering if it makes sense for me to change this to my own user, so it is easier to interact with files and I don't need to sudo? Why would this be a bad idea to do?

1 Answers1

43

The main reason for the recommendation of running Transmission as its own dedicated system user rather than your user is that, if the software has a vulnerability that allows exploits that will expose files outside of its configured directory, then it will not end up exposing the possibly sensitive files from your home directory, since Linux itself will prevent that kind of access through the basic permissions.

In order to make it easier to manage the files in Transmission's directory with your regular user, you should consider adding your user to the debian-transmission group, which is the group that owns the files in the Transmission directory, and has (or at least should have) read/write access to that directory and the files within it.

The Ubuntu howto suggests this command (slightly adapted to get your user from an environment variable):

sudo usermod -a -G debian-transmission "$USER"

(Remember to log out and log in again after running usermod, as it will not affect the groups of any existing process.)

Hopefully this will make it easier for you to manage the files downloaded with Transmission, while still keeping it running under its own dedicated system user, for better security.

ilkkachu
  • 138,973
filbranden
  • 21,751
  • 4
  • 63
  • 86
  • 1
    I was just having the same issue myself and have been considering changing the service to regular user. This is a lot better. Thanks! – Alko Jul 15 '19 at 09:04
  • 3
    You can also but default permissions on the directory, to give you permission, using setfacl. see https://unix.stackexchange.com/questions/101263/what-are-the-different-ways-to-set-file-permissions-etc-on-gnu-linux/101269 – ctrl-alt-delor Jul 15 '19 at 09:29
  • 1
    Hey, thanks a lot. – ScipioAfricanus Jul 16 '19 at 16:29
  • 1
    I was just wondering how to do this in the context of rtorrent and am happy to see this answer for running transmission! – Tom Russell Jun 25 '21 at 03:17