How do I change the user Transmission runs under?transmission-daemon: error loading working config-file. User priveliges?How do I start jobs as a non privileged user in Upstart?How can I use transmission-daemon with a download folder on a ntfs file system?How does dhclient get called under 12.04Starting java processes with UpstartTransmission dependencies are not in repositorytransmission-daemon: error loading working config-file. User priveliges?How can I alternate between two kiosk-mode appplications?Does upstart really handle all startup scripts?Granting daemon permissions to read/write to a folder owned by userRestarted Ubuntu Server, now Transmission Daemon fails to start suddenly

How to tell my Mom that I don't care about someone without upsetting her?

When did Hebrew start replacing Yiddish?

Is there a way to add salted hashing to my user authentication without breaking my former login server

Max flow problem without splitting the flow from the supply nodes - LP formulation help

Do you need to reveal which specific tunnel you’re attempting to claim?

Was there a "mechanist" program of early rationalists, like Descartes and Leibniz?

Simple Markdown viewer for Windows

How to pay less taxes on a high salary?

Can socialism and capitalism coexist in the same country?

What attributes of a Pokemon can be improved?

Next Shared Totient

Where to start with a child learning chess?

What is homebrew? Should I use it in normal games?

What does 36.000€ mean?

Why "alle Tale" and not "alle Täler"?

Prefix all commands in shell

How true are Trump’s claims about NATO spending?

How to protect assets from being passed to a beneficiary in a will when they are likely to die soon also

Can two moons have intersecting orbits yet be guaranteed not to collide?

Did the computer mouse always output relative x/y and not absolute?

Looking for a restaurant in Vienna with a name similar to "An die 2 Linsen" that served huge Schnitzel

Why do cargo airlines frequently choose passenger aircraft rather than aircraft designed specifically for cargo?

How could pirates reasonably transport dinosaurs in captivity, some of them enormous, across oceans?

When to bemoan and when to moan



How do I change the user Transmission runs under?


transmission-daemon: error loading working config-file. User priveliges?How do I start jobs as a non privileged user in Upstart?How can I use transmission-daemon with a download folder on a ntfs file system?How does dhclient get called under 12.04Starting java processes with UpstartTransmission dependencies are not in repositorytransmission-daemon: error loading working config-file. User priveliges?How can I alternate between two kiosk-mode appplications?Does upstart really handle all startup scripts?Granting daemon permissions to read/write to a folder owned by userRestarted Ubuntu Server, now Transmission Daemon fails to start suddenly






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









10


















I installed Transmission through a PPA and the daemon starts on boot. I want to change the user that runs the daemon because I want the downloaded files to be under the same user as my XBMC installation, and I can't seem to find where to edit that.



The daemon uses upstart so there is nothing about which users runs it in /etc/init.d/transmission-daemon and there isn't anything in /etc/default/transmission-daemon about the user either



I'm using these ppas for transmission:



/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list:deb //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list:deb-src //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list.save:deb //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list.save:deb-src //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main









share|improve this question



























  • Can you please provide the PPA and the version of Ubuntu? Everywhere I looked the transmission-daemon package does have the /etc/init.d/transmission-daemon file.

    – arrange
    Feb 25 '13 at 21:34












  • Sorry if I wasn't clear, I meant that there isn't anything about which user runs the daemon in that file

    – BvdBijl
    Feb 25 '13 at 21:35











  • At the start of the /etc/init.d/transmission-daemon file you should see the line "USER=debian-transmission"; that should be it.

    – arrange
    Feb 25 '13 at 21:38











  • Mine looks like this: gist.github.com/boukevanderbijl/04c7d6a322a08e9629cb

    – BvdBijl
    Feb 25 '13 at 21:40











  • I added which PPAs I use in the starting post

    – BvdBijl
    Feb 25 '13 at 21:43

















10


















I installed Transmission through a PPA and the daemon starts on boot. I want to change the user that runs the daemon because I want the downloaded files to be under the same user as my XBMC installation, and I can't seem to find where to edit that.



The daemon uses upstart so there is nothing about which users runs it in /etc/init.d/transmission-daemon and there isn't anything in /etc/default/transmission-daemon about the user either



I'm using these ppas for transmission:



/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list:deb //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list:deb-src //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list.save:deb //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list.save:deb-src //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main









share|improve this question



























  • Can you please provide the PPA and the version of Ubuntu? Everywhere I looked the transmission-daemon package does have the /etc/init.d/transmission-daemon file.

    – arrange
    Feb 25 '13 at 21:34












  • Sorry if I wasn't clear, I meant that there isn't anything about which user runs the daemon in that file

    – BvdBijl
    Feb 25 '13 at 21:35











  • At the start of the /etc/init.d/transmission-daemon file you should see the line "USER=debian-transmission"; that should be it.

    – arrange
    Feb 25 '13 at 21:38











  • Mine looks like this: gist.github.com/boukevanderbijl/04c7d6a322a08e9629cb

    – BvdBijl
    Feb 25 '13 at 21:40











  • I added which PPAs I use in the starting post

    – BvdBijl
    Feb 25 '13 at 21:43













10













10









10


3






I installed Transmission through a PPA and the daemon starts on boot. I want to change the user that runs the daemon because I want the downloaded files to be under the same user as my XBMC installation, and I can't seem to find where to edit that.



The daemon uses upstart so there is nothing about which users runs it in /etc/init.d/transmission-daemon and there isn't anything in /etc/default/transmission-daemon about the user either



I'm using these ppas for transmission:



/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list:deb //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list:deb-src //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list.save:deb //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list.save:deb-src //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main









share|improve this question
















I installed Transmission through a PPA and the daemon starts on boot. I want to change the user that runs the daemon because I want the downloaded files to be under the same user as my XBMC installation, and I can't seem to find where to edit that.



The daemon uses upstart so there is nothing about which users runs it in /etc/init.d/transmission-daemon and there isn't anything in /etc/default/transmission-daemon about the user either



I'm using these ppas for transmission:



/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list:deb //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list:deb-src //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list.save:deb //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main

/etc/apt/sources.list.d/transmissionbt-ppa-quantal.list.save:deb-src //ppa.launchpad.net/transmissionbt/ppa/ubuntu quantal main






services upstart transmission






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 25 '13 at 23:24









carnendil

5,0651 gold badge23 silver badges53 bronze badges




5,0651 gold badge23 silver badges53 bronze badges










asked Feb 25 '13 at 21:17









BvdBijlBvdBijl

2031 gold badge2 silver badges5 bronze badges




2031 gold badge2 silver badges5 bronze badges















  • Can you please provide the PPA and the version of Ubuntu? Everywhere I looked the transmission-daemon package does have the /etc/init.d/transmission-daemon file.

    – arrange
    Feb 25 '13 at 21:34












  • Sorry if I wasn't clear, I meant that there isn't anything about which user runs the daemon in that file

    – BvdBijl
    Feb 25 '13 at 21:35











  • At the start of the /etc/init.d/transmission-daemon file you should see the line "USER=debian-transmission"; that should be it.

    – arrange
    Feb 25 '13 at 21:38











  • Mine looks like this: gist.github.com/boukevanderbijl/04c7d6a322a08e9629cb

    – BvdBijl
    Feb 25 '13 at 21:40











  • I added which PPAs I use in the starting post

    – BvdBijl
    Feb 25 '13 at 21:43

















  • Can you please provide the PPA and the version of Ubuntu? Everywhere I looked the transmission-daemon package does have the /etc/init.d/transmission-daemon file.

    – arrange
    Feb 25 '13 at 21:34












  • Sorry if I wasn't clear, I meant that there isn't anything about which user runs the daemon in that file

    – BvdBijl
    Feb 25 '13 at 21:35











  • At the start of the /etc/init.d/transmission-daemon file you should see the line "USER=debian-transmission"; that should be it.

    – arrange
    Feb 25 '13 at 21:38











  • Mine looks like this: gist.github.com/boukevanderbijl/04c7d6a322a08e9629cb

    – BvdBijl
    Feb 25 '13 at 21:40











  • I added which PPAs I use in the starting post

    – BvdBijl
    Feb 25 '13 at 21:43
















Can you please provide the PPA and the version of Ubuntu? Everywhere I looked the transmission-daemon package does have the /etc/init.d/transmission-daemon file.

– arrange
Feb 25 '13 at 21:34






Can you please provide the PPA and the version of Ubuntu? Everywhere I looked the transmission-daemon package does have the /etc/init.d/transmission-daemon file.

– arrange
Feb 25 '13 at 21:34














Sorry if I wasn't clear, I meant that there isn't anything about which user runs the daemon in that file

– BvdBijl
Feb 25 '13 at 21:35





Sorry if I wasn't clear, I meant that there isn't anything about which user runs the daemon in that file

– BvdBijl
Feb 25 '13 at 21:35













At the start of the /etc/init.d/transmission-daemon file you should see the line "USER=debian-transmission"; that should be it.

– arrange
Feb 25 '13 at 21:38





At the start of the /etc/init.d/transmission-daemon file you should see the line "USER=debian-transmission"; that should be it.

– arrange
Feb 25 '13 at 21:38













Mine looks like this: gist.github.com/boukevanderbijl/04c7d6a322a08e9629cb

– BvdBijl
Feb 25 '13 at 21:40





Mine looks like this: gist.github.com/boukevanderbijl/04c7d6a322a08e9629cb

– BvdBijl
Feb 25 '13 at 21:40













I added which PPAs I use in the starting post

– BvdBijl
Feb 25 '13 at 21:43





I added which PPAs I use in the starting post

– BvdBijl
Feb 25 '13 at 21:43










7 Answers
7






active

oldest

votes


















4



















As of upstart v1.4, setuid and setgid are supported natively in config file:



setgid <groupname>


and



setuid <username>


Before v1.4 you can use this (as described here):



exec start-stop-daemon --start -c user --exec command





share|improve this answer




















  • 2





    I have to edit /etc/init/transmission-daemon.conf

    – BvdBijl
    Feb 25 '13 at 22:03






  • 1





    I had also to sudo chown -R user:group /var/lib/transmission-daemon/ like said askubuntu.com/questions/290943/…

    – Philippe Gachoud
    May 5 '15 at 9:28



















15



















Since all of the other answers are for Ubuntu pre-systemd, here's an updated guide for Ubuntu 16.04 (from sensecodons.com). Essentially, create a supplementary unit for "transmission-daemon.service" to change the User=... setting and then update that user's "~/.config/transmission-daemon/settings.json" file.




Stop transmission (if it's already running).



sudo systemctl stop transmission-daemon


Create the supplement file directory for transmission:



sudo mkdir -p /etc/systemd/system/transmission-daemon.service.d


Create a new supplement file called "run-as-user.conf".



sudo vi /etc/systemd/system/transmission-daemon.service.d/run-as-user.conf


and put the following text in it.



[Service]
User=codon


Obviously, use your desired username and not "codon".



Tell systemd to reload its units.



sudo systemctl daemon-reload



Next, you'll want to start and then stop transmission to make it create the ~/.config/transmission-daemon/ directory for your new user.




Start transmission and then stop transmission.



sudo systemctl start transmission-daemon; sudo systemctl stop transmission-daemon


You should now have the following directory in your user's home directory:
.config/transmission-daemon/




From here, you should be able to update ~/.config/transmission-daemon/settings.json normally.



When you're done, start transmission.



sudo systemctl start transmission-daemon





share|improve this answer






















  • 3





    Instead of manually creating that directory and file, use systemctl edit transmission-daemon.service, which will automatically 1. create that directory and file, and 2. when you save and exit, run systemctl daemon-reload as well.

    – muru
    Jan 9 '17 at 7:35


















7



















Assumptions:



  • You used this PPA: ppa:transmissionbt/ppa

  • You want to run Transmission with user: some_user and group: some_group

For System V (SysV) init system (eg: Ubuntu 10.04 LTS):




  1. Stop the Transmission Daemon:



    sudo service transmission-daemon stop



  2. Edit the init.d scripts



    sudo nano /etc/init.d/transmission-daemon


    ...and change USER=debian-transmission to USER=some_user



For Upstart init system (eg: Ubuntu 14.04 LTS):




  1. Stop the Transmission Daemon:



    sudo service transmission-daemon stop



  2. Edit the init scripts:



    sudo nano /etc/init/transmission-daemon.conf


    ...and edit as follows:



    • change setuid debian-transmission to setuid some_user


    • and change setgid debian-transmission to setgid some_group



For systemd init system (eg: Ubuntu 16.04 LTS):




  1. Stop the Transmission Daemon:



    sudo systemctl stop transmission-daemon.service



  2. Create systemd override.conf file:



    sudo systemctl edit transmission-daemon.service


    ...and edit as follows:



    [Service]
    User=
    User=some_user
    Group=
    Group=some_group


    Notes:



    • This creates the following file: /etc/systemd/system/transmission-daemon.service.d/override.conf



    • The empty variable assignments (eg: User=) are used to clear/reset the value in the existing variable. This seems to be how things are done when using drop-in replacement of the systemd unit file. See: "Example 2. Overriding vendor settings" in systemd.unit manual:




      "...for drop-in files, if one wants to remove entries from a setting that is parsed as a list (and is not a dependency), ... one needs to first clear the list before re-adding all entries except the one that is to be removed..."






  3. Systemd reload and start transmission daemon:



    sudo systemctl daemon-reload
    sudo systemctl start transmission-daemon.service


    Note: Unlike with Upstart and SysV init systems transmission-daemon saves all configuration and settings in /home/some_user/.config/transmission-daemon/ instead of /etc/transmission-daemon/settings.json and /var/lib/transmission-daemon



Notes & References



  • /etc/default/transmission-daemon is used only by the Upstart scripts (/etc/init.d/transmission-daemon) and SysV scripts (/etc/init/transmission-daemon.conf) and so if you are using Systemd init system then you can ignore all these files.


  • Running transmission as a user in Ubuntu 16.04


  • Reddit: Changing systemd user with drop-in replacement for transmission-daemon not working


  • Stack-Exchange: Changing systemd user with drop-in replacement for transmission-daemon not working



Optional/Additional Information regarding permissions and package updates:




Note: The following is likely only relevant for Upstart and SysV init systems only




Changing Permissions on Transmission's configuration files



If you are not using systemd init system you may now need to change the permissions for Transmission's Configuration files from user=debian-transmission to user=some_user and from group=debian-transmission to group=some_group.




  1. Check the location of your Transmission Configuration Directory. You can find it mentioned in the /etc/default/transmission-daemon file as a line like so:



    CONFIG_DIR="/var/lib/transmission-daemon/info"



  2. So assuming your Configuration Directory is /var/lib/transmission-daemon/info, change ownership of configuration files:



    sudo chown some_user:some_group /var/lib/transmission-daemon/downloads
    sudo chown some_user:some_group /var/lib/transmission-daemon/info
    sudo chown some_user:some_group /var/lib/transmission-daemon/info/blocklists
    sudo chown some_user:some_group /var/lib/transmission-daemon/info/dht.dat
    sudo chown some_user:some_group /var/lib/transmission-daemon/info/resume
    sudo chown some_user:some_group /var/lib/transmission-daemon/info/torrents



  3. Change ownership of other files:



    sudo chown :some_group /etc/transmission-daemon
    sudo chown some_user:some_group /etc/transmission-daemon/settings.json


Extra Information (updating Transmission):



Because you changed the default user you may find that after updating Transmission using the repository (eg: apt-get upgrade) the transmission daemon is no longer running.



Running "sudo apt-get -f install" give the following error:



Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up transmission-daemon (2.84-0ubuntu0.12.04.1) ...
* Starting bittorrent daemon transmission-daemon
invoke-rc.d: initscript transmission-daemon, action "start" failed.
dpkg: error processing transmission-daemon (--configure):
subprocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
transmission-daemon
E: Sub-process /usr/bin/dpkg returned an error code (1)


The reason the daemon fails to start ("invoke-rc.d: initscript transmission-daemon, action "start" failed.") is because we changed permissions from "debian-transmission" to "some_user" and after the update these got reset. So to fix just do the following:




  1. Stop Daemon and Edit config file:



    sudo service transmission-daemon stop
    sudo nano /etc/init.d/transmission-daemon


    ...and change USER=some_user to USER=debian-transmission




  2. Re-try fixing update by running:



    sudo apt-get -f install


  3. If the update succeeds the Transmission daemon should now be running. You can now follow steps above to change user/group again.






share|improve this answer


































    6



















    This is not the complete story. Apart from changing



    setgid <groupname>


    and



    setuid <username>


    in



    /etc/init/transmission-daemon.conf


    you also need to change the permissions of the config file of transmission-daemon. Otherwise it won't be able to rewrite settings to this file and the daemon will restart until upstart thinks it had enough chances (init: transmission-daemon respawning too fast, stopped)



    sudo chown <user>:<group> /etc/transmission-daemon/settings.json
    sudo chown -R <user>:<group> /var/lib/transmission-daemon/





    share|improve this answer



























    • Thanks for the bit about changing the permissions of settings.json. Missed that.

      – nighthawk454
      Mar 27 '17 at 6:12


















    2



















    On systems using systemd, the file you want to edit may actually be:



    /etc/systemd/system/multi-user.target.wants/transmission-daemon.service



    Follow up editing with:



    sudo systemctl daemon-reload






    share|improve this answer



























    • This is what helped me. I did all other steps but didn't work. Thank you!

      – Martijn Smidt
      Dec 26 '15 at 13:20


















    2



















    In Ubuntu 16.04 the startup service was changed from upstart to systemd, making must of the previous answers obsolete. To change the user transmission-daemon runs execute:



    Stop daemon:



    sudo service transmission-daemon stop


    Change ownership of configuration files and "home":



    sudo chown -R USER:USER /var/lib/transmission-daemon/*
    sudo chown -R USER:USER /etc/transmission-daemon/settings.json


    Then edit file /lib/systemd/system/transmission-daemon.service with:



    [Unit]
    Description=Transmission BitTorrent Daemon
    After=network.target

    [Service]
    User=USER
    Type=notify
    ExecStart=/usr/bin/transmission-daemon -f --log-debug --config-dir /var/lib/transmission-daemon/info
    ExecReload=/bin/kill -s HUP $MAINPID

    [Install]
    WantedBy=multi-user.target


    Please note the User, --config-dirand the --log-debug changes.



    Reload systemd configuration:



    sudo systemctl daemon-reload


    Start daemon again:



    sudo service transmission-daemon start


    Once you have set the --log-debug (which will give you more information of any issue) option you can get the daemon's log:



    sudo journalctl -u transmission-daemon.service


    Done.



    Things to note:



    You can ignore files:



    /etc/default/transmission-daemon: It seems that nobody is sourcing it in systemd systems.



    /etc/init.d/transmission-daemon: It seems that this was the old system 5 start script.



    /etc/init/transmission-daemon.conf: It seems that this is the old upstart start script.






    share|improve this answer




















    • 2





      Do not edit /lib/systemd/system/transmission-daemon.service manually. Use systemctl edit transmission-daemon.service instead, or your changes will be lost when you upgrade the package.

      – muru
      Jan 9 '17 at 7:30


















    0



















    I did the following, which to me seems less invasive than the other answers.




    1. Remove the startup of transmission-daemon:



      sudo update-rc.d -f transmission-daemon remove



    2. Add the following to /etc/profile:



      if [ -f "$HOME/.autostart" ]; then
      $HOME/.autostart
      fi



    3. Create ~/.autostart:



      #!/bin/bash
      if [ -z "$(pidof transmission-daemon)" ]; then
      /usr/bin/transmission-daemon --config-dir /home/[USERNAME]/.config/transmission-daemon &
      fi


    This is a bit more portable perhaps, it works for me on plain Debian and minibian too.






    share|improve this answer

























    • not a bad idea but it requires that the user logins with a shell that executes /etc/profile (zsh doesn't execute it, for example)

      – elboletaire
      Oct 11 '15 at 9:19












    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f261252%2fhow-do-i-change-the-user-transmission-runs-under%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown


























    7 Answers
    7






    active

    oldest

    votes








    7 Answers
    7






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4



















    As of upstart v1.4, setuid and setgid are supported natively in config file:



    setgid <groupname>


    and



    setuid <username>


    Before v1.4 you can use this (as described here):



    exec start-stop-daemon --start -c user --exec command





    share|improve this answer




















    • 2





      I have to edit /etc/init/transmission-daemon.conf

      – BvdBijl
      Feb 25 '13 at 22:03






    • 1





      I had also to sudo chown -R user:group /var/lib/transmission-daemon/ like said askubuntu.com/questions/290943/…

      – Philippe Gachoud
      May 5 '15 at 9:28
















    4



















    As of upstart v1.4, setuid and setgid are supported natively in config file:



    setgid <groupname>


    and



    setuid <username>


    Before v1.4 you can use this (as described here):



    exec start-stop-daemon --start -c user --exec command





    share|improve this answer




















    • 2





      I have to edit /etc/init/transmission-daemon.conf

      – BvdBijl
      Feb 25 '13 at 22:03






    • 1





      I had also to sudo chown -R user:group /var/lib/transmission-daemon/ like said askubuntu.com/questions/290943/…

      – Philippe Gachoud
      May 5 '15 at 9:28














    4















    4











    4









    As of upstart v1.4, setuid and setgid are supported natively in config file:



    setgid <groupname>


    and



    setuid <username>


    Before v1.4 you can use this (as described here):



    exec start-stop-daemon --start -c user --exec command





    share|improve this answer














    As of upstart v1.4, setuid and setgid are supported natively in config file:



    setgid <groupname>


    and



    setuid <username>


    Before v1.4 you can use this (as described here):



    exec start-stop-daemon --start -c user --exec command






    share|improve this answer













    share|improve this answer




    share|improve this answer










    answered Feb 25 '13 at 21:51









    RinzwindRinzwind

    228k30 gold badges440 silver badges583 bronze badges




    228k30 gold badges440 silver badges583 bronze badges










    • 2





      I have to edit /etc/init/transmission-daemon.conf

      – BvdBijl
      Feb 25 '13 at 22:03






    • 1





      I had also to sudo chown -R user:group /var/lib/transmission-daemon/ like said askubuntu.com/questions/290943/…

      – Philippe Gachoud
      May 5 '15 at 9:28













    • 2





      I have to edit /etc/init/transmission-daemon.conf

      – BvdBijl
      Feb 25 '13 at 22:03






    • 1





      I had also to sudo chown -R user:group /var/lib/transmission-daemon/ like said askubuntu.com/questions/290943/…

      – Philippe Gachoud
      May 5 '15 at 9:28








    2




    2





    I have to edit /etc/init/transmission-daemon.conf

    – BvdBijl
    Feb 25 '13 at 22:03





    I have to edit /etc/init/transmission-daemon.conf

    – BvdBijl
    Feb 25 '13 at 22:03




    1




    1





    I had also to sudo chown -R user:group /var/lib/transmission-daemon/ like said askubuntu.com/questions/290943/…

    – Philippe Gachoud
    May 5 '15 at 9:28






    I had also to sudo chown -R user:group /var/lib/transmission-daemon/ like said askubuntu.com/questions/290943/…

    – Philippe Gachoud
    May 5 '15 at 9:28














    15



















    Since all of the other answers are for Ubuntu pre-systemd, here's an updated guide for Ubuntu 16.04 (from sensecodons.com). Essentially, create a supplementary unit for "transmission-daemon.service" to change the User=... setting and then update that user's "~/.config/transmission-daemon/settings.json" file.




    Stop transmission (if it's already running).



    sudo systemctl stop transmission-daemon


    Create the supplement file directory for transmission:



    sudo mkdir -p /etc/systemd/system/transmission-daemon.service.d


    Create a new supplement file called "run-as-user.conf".



    sudo vi /etc/systemd/system/transmission-daemon.service.d/run-as-user.conf


    and put the following text in it.



    [Service]
    User=codon


    Obviously, use your desired username and not "codon".



    Tell systemd to reload its units.



    sudo systemctl daemon-reload



    Next, you'll want to start and then stop transmission to make it create the ~/.config/transmission-daemon/ directory for your new user.




    Start transmission and then stop transmission.



    sudo systemctl start transmission-daemon; sudo systemctl stop transmission-daemon


    You should now have the following directory in your user's home directory:
    .config/transmission-daemon/




    From here, you should be able to update ~/.config/transmission-daemon/settings.json normally.



    When you're done, start transmission.



    sudo systemctl start transmission-daemon





    share|improve this answer






















    • 3





      Instead of manually creating that directory and file, use systemctl edit transmission-daemon.service, which will automatically 1. create that directory and file, and 2. when you save and exit, run systemctl daemon-reload as well.

      – muru
      Jan 9 '17 at 7:35















    15



















    Since all of the other answers are for Ubuntu pre-systemd, here's an updated guide for Ubuntu 16.04 (from sensecodons.com). Essentially, create a supplementary unit for "transmission-daemon.service" to change the User=... setting and then update that user's "~/.config/transmission-daemon/settings.json" file.




    Stop transmission (if it's already running).



    sudo systemctl stop transmission-daemon


    Create the supplement file directory for transmission:



    sudo mkdir -p /etc/systemd/system/transmission-daemon.service.d


    Create a new supplement file called "run-as-user.conf".



    sudo vi /etc/systemd/system/transmission-daemon.service.d/run-as-user.conf


    and put the following text in it.



    [Service]
    User=codon


    Obviously, use your desired username and not "codon".



    Tell systemd to reload its units.



    sudo systemctl daemon-reload



    Next, you'll want to start and then stop transmission to make it create the ~/.config/transmission-daemon/ directory for your new user.




    Start transmission and then stop transmission.



    sudo systemctl start transmission-daemon; sudo systemctl stop transmission-daemon


    You should now have the following directory in your user's home directory:
    .config/transmission-daemon/




    From here, you should be able to update ~/.config/transmission-daemon/settings.json normally.



    When you're done, start transmission.



    sudo systemctl start transmission-daemon





    share|improve this answer






















    • 3





      Instead of manually creating that directory and file, use systemctl edit transmission-daemon.service, which will automatically 1. create that directory and file, and 2. when you save and exit, run systemctl daemon-reload as well.

      – muru
      Jan 9 '17 at 7:35













    15















    15











    15









    Since all of the other answers are for Ubuntu pre-systemd, here's an updated guide for Ubuntu 16.04 (from sensecodons.com). Essentially, create a supplementary unit for "transmission-daemon.service" to change the User=... setting and then update that user's "~/.config/transmission-daemon/settings.json" file.




    Stop transmission (if it's already running).



    sudo systemctl stop transmission-daemon


    Create the supplement file directory for transmission:



    sudo mkdir -p /etc/systemd/system/transmission-daemon.service.d


    Create a new supplement file called "run-as-user.conf".



    sudo vi /etc/systemd/system/transmission-daemon.service.d/run-as-user.conf


    and put the following text in it.



    [Service]
    User=codon


    Obviously, use your desired username and not "codon".



    Tell systemd to reload its units.



    sudo systemctl daemon-reload



    Next, you'll want to start and then stop transmission to make it create the ~/.config/transmission-daemon/ directory for your new user.




    Start transmission and then stop transmission.



    sudo systemctl start transmission-daemon; sudo systemctl stop transmission-daemon


    You should now have the following directory in your user's home directory:
    .config/transmission-daemon/




    From here, you should be able to update ~/.config/transmission-daemon/settings.json normally.



    When you're done, start transmission.



    sudo systemctl start transmission-daemon





    share|improve this answer
















    Since all of the other answers are for Ubuntu pre-systemd, here's an updated guide for Ubuntu 16.04 (from sensecodons.com). Essentially, create a supplementary unit for "transmission-daemon.service" to change the User=... setting and then update that user's "~/.config/transmission-daemon/settings.json" file.




    Stop transmission (if it's already running).



    sudo systemctl stop transmission-daemon


    Create the supplement file directory for transmission:



    sudo mkdir -p /etc/systemd/system/transmission-daemon.service.d


    Create a new supplement file called "run-as-user.conf".



    sudo vi /etc/systemd/system/transmission-daemon.service.d/run-as-user.conf


    and put the following text in it.



    [Service]
    User=codon


    Obviously, use your desired username and not "codon".



    Tell systemd to reload its units.



    sudo systemctl daemon-reload



    Next, you'll want to start and then stop transmission to make it create the ~/.config/transmission-daemon/ directory for your new user.




    Start transmission and then stop transmission.



    sudo systemctl start transmission-daemon; sudo systemctl stop transmission-daemon


    You should now have the following directory in your user's home directory:
    .config/transmission-daemon/




    From here, you should be able to update ~/.config/transmission-daemon/settings.json normally.



    When you're done, start transmission.



    sudo systemctl start transmission-daemon






    share|improve this answer















    share|improve this answer




    share|improve this answer








    edited Jan 9 '17 at 7:33









    muru

    1




    1










    answered Jan 9 '17 at 1:21









    Douglas ManleyDouglas Manley

    2502 silver badges4 bronze badges




    2502 silver badges4 bronze badges










    • 3





      Instead of manually creating that directory and file, use systemctl edit transmission-daemon.service, which will automatically 1. create that directory and file, and 2. when you save and exit, run systemctl daemon-reload as well.

      – muru
      Jan 9 '17 at 7:35












    • 3





      Instead of manually creating that directory and file, use systemctl edit transmission-daemon.service, which will automatically 1. create that directory and file, and 2. when you save and exit, run systemctl daemon-reload as well.

      – muru
      Jan 9 '17 at 7:35







    3




    3





    Instead of manually creating that directory and file, use systemctl edit transmission-daemon.service, which will automatically 1. create that directory and file, and 2. when you save and exit, run systemctl daemon-reload as well.

    – muru
    Jan 9 '17 at 7:35





    Instead of manually creating that directory and file, use systemctl edit transmission-daemon.service, which will automatically 1. create that directory and file, and 2. when you save and exit, run systemctl daemon-reload as well.

    – muru
    Jan 9 '17 at 7:35











    7



















    Assumptions:



    • You used this PPA: ppa:transmissionbt/ppa

    • You want to run Transmission with user: some_user and group: some_group

    For System V (SysV) init system (eg: Ubuntu 10.04 LTS):




    1. Stop the Transmission Daemon:



      sudo service transmission-daemon stop



    2. Edit the init.d scripts



      sudo nano /etc/init.d/transmission-daemon


      ...and change USER=debian-transmission to USER=some_user



    For Upstart init system (eg: Ubuntu 14.04 LTS):




    1. Stop the Transmission Daemon:



      sudo service transmission-daemon stop



    2. Edit the init scripts:



      sudo nano /etc/init/transmission-daemon.conf


      ...and edit as follows:



      • change setuid debian-transmission to setuid some_user


      • and change setgid debian-transmission to setgid some_group



    For systemd init system (eg: Ubuntu 16.04 LTS):




    1. Stop the Transmission Daemon:



      sudo systemctl stop transmission-daemon.service



    2. Create systemd override.conf file:



      sudo systemctl edit transmission-daemon.service


      ...and edit as follows:



      [Service]
      User=
      User=some_user
      Group=
      Group=some_group


      Notes:



      • This creates the following file: /etc/systemd/system/transmission-daemon.service.d/override.conf



      • The empty variable assignments (eg: User=) are used to clear/reset the value in the existing variable. This seems to be how things are done when using drop-in replacement of the systemd unit file. See: "Example 2. Overriding vendor settings" in systemd.unit manual:




        "...for drop-in files, if one wants to remove entries from a setting that is parsed as a list (and is not a dependency), ... one needs to first clear the list before re-adding all entries except the one that is to be removed..."






    3. Systemd reload and start transmission daemon:



      sudo systemctl daemon-reload
      sudo systemctl start transmission-daemon.service


      Note: Unlike with Upstart and SysV init systems transmission-daemon saves all configuration and settings in /home/some_user/.config/transmission-daemon/ instead of /etc/transmission-daemon/settings.json and /var/lib/transmission-daemon



    Notes & References



    • /etc/default/transmission-daemon is used only by the Upstart scripts (/etc/init.d/transmission-daemon) and SysV scripts (/etc/init/transmission-daemon.conf) and so if you are using Systemd init system then you can ignore all these files.


    • Running transmission as a user in Ubuntu 16.04


    • Reddit: Changing systemd user with drop-in replacement for transmission-daemon not working


    • Stack-Exchange: Changing systemd user with drop-in replacement for transmission-daemon not working



    Optional/Additional Information regarding permissions and package updates:




    Note: The following is likely only relevant for Upstart and SysV init systems only




    Changing Permissions on Transmission's configuration files



    If you are not using systemd init system you may now need to change the permissions for Transmission's Configuration files from user=debian-transmission to user=some_user and from group=debian-transmission to group=some_group.




    1. Check the location of your Transmission Configuration Directory. You can find it mentioned in the /etc/default/transmission-daemon file as a line like so:



      CONFIG_DIR="/var/lib/transmission-daemon/info"



    2. So assuming your Configuration Directory is /var/lib/transmission-daemon/info, change ownership of configuration files:



      sudo chown some_user:some_group /var/lib/transmission-daemon/downloads
      sudo chown some_user:some_group /var/lib/transmission-daemon/info
      sudo chown some_user:some_group /var/lib/transmission-daemon/info/blocklists
      sudo chown some_user:some_group /var/lib/transmission-daemon/info/dht.dat
      sudo chown some_user:some_group /var/lib/transmission-daemon/info/resume
      sudo chown some_user:some_group /var/lib/transmission-daemon/info/torrents



    3. Change ownership of other files:



      sudo chown :some_group /etc/transmission-daemon
      sudo chown some_user:some_group /etc/transmission-daemon/settings.json


    Extra Information (updating Transmission):



    Because you changed the default user you may find that after updating Transmission using the repository (eg: apt-get upgrade) the transmission daemon is no longer running.



    Running "sudo apt-get -f install" give the following error:



    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up transmission-daemon (2.84-0ubuntu0.12.04.1) ...
    * Starting bittorrent daemon transmission-daemon
    invoke-rc.d: initscript transmission-daemon, action "start" failed.
    dpkg: error processing transmission-daemon (--configure):
    subprocess installed post-installation script returned error exit status 255
    Errors were encountered while processing:
    transmission-daemon
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    The reason the daemon fails to start ("invoke-rc.d: initscript transmission-daemon, action "start" failed.") is because we changed permissions from "debian-transmission" to "some_user" and after the update these got reset. So to fix just do the following:




    1. Stop Daemon and Edit config file:



      sudo service transmission-daemon stop
      sudo nano /etc/init.d/transmission-daemon


      ...and change USER=some_user to USER=debian-transmission




    2. Re-try fixing update by running:



      sudo apt-get -f install


    3. If the update succeeds the Transmission daemon should now be running. You can now follow steps above to change user/group again.






    share|improve this answer































      7



















      Assumptions:



      • You used this PPA: ppa:transmissionbt/ppa

      • You want to run Transmission with user: some_user and group: some_group

      For System V (SysV) init system (eg: Ubuntu 10.04 LTS):




      1. Stop the Transmission Daemon:



        sudo service transmission-daemon stop



      2. Edit the init.d scripts



        sudo nano /etc/init.d/transmission-daemon


        ...and change USER=debian-transmission to USER=some_user



      For Upstart init system (eg: Ubuntu 14.04 LTS):




      1. Stop the Transmission Daemon:



        sudo service transmission-daemon stop



      2. Edit the init scripts:



        sudo nano /etc/init/transmission-daemon.conf


        ...and edit as follows:



        • change setuid debian-transmission to setuid some_user


        • and change setgid debian-transmission to setgid some_group



      For systemd init system (eg: Ubuntu 16.04 LTS):




      1. Stop the Transmission Daemon:



        sudo systemctl stop transmission-daemon.service



      2. Create systemd override.conf file:



        sudo systemctl edit transmission-daemon.service


        ...and edit as follows:



        [Service]
        User=
        User=some_user
        Group=
        Group=some_group


        Notes:



        • This creates the following file: /etc/systemd/system/transmission-daemon.service.d/override.conf



        • The empty variable assignments (eg: User=) are used to clear/reset the value in the existing variable. This seems to be how things are done when using drop-in replacement of the systemd unit file. See: "Example 2. Overriding vendor settings" in systemd.unit manual:




          "...for drop-in files, if one wants to remove entries from a setting that is parsed as a list (and is not a dependency), ... one needs to first clear the list before re-adding all entries except the one that is to be removed..."






      3. Systemd reload and start transmission daemon:



        sudo systemctl daemon-reload
        sudo systemctl start transmission-daemon.service


        Note: Unlike with Upstart and SysV init systems transmission-daemon saves all configuration and settings in /home/some_user/.config/transmission-daemon/ instead of /etc/transmission-daemon/settings.json and /var/lib/transmission-daemon



      Notes & References



      • /etc/default/transmission-daemon is used only by the Upstart scripts (/etc/init.d/transmission-daemon) and SysV scripts (/etc/init/transmission-daemon.conf) and so if you are using Systemd init system then you can ignore all these files.


      • Running transmission as a user in Ubuntu 16.04


      • Reddit: Changing systemd user with drop-in replacement for transmission-daemon not working


      • Stack-Exchange: Changing systemd user with drop-in replacement for transmission-daemon not working



      Optional/Additional Information regarding permissions and package updates:




      Note: The following is likely only relevant for Upstart and SysV init systems only




      Changing Permissions on Transmission's configuration files



      If you are not using systemd init system you may now need to change the permissions for Transmission's Configuration files from user=debian-transmission to user=some_user and from group=debian-transmission to group=some_group.




      1. Check the location of your Transmission Configuration Directory. You can find it mentioned in the /etc/default/transmission-daemon file as a line like so:



        CONFIG_DIR="/var/lib/transmission-daemon/info"



      2. So assuming your Configuration Directory is /var/lib/transmission-daemon/info, change ownership of configuration files:



        sudo chown some_user:some_group /var/lib/transmission-daemon/downloads
        sudo chown some_user:some_group /var/lib/transmission-daemon/info
        sudo chown some_user:some_group /var/lib/transmission-daemon/info/blocklists
        sudo chown some_user:some_group /var/lib/transmission-daemon/info/dht.dat
        sudo chown some_user:some_group /var/lib/transmission-daemon/info/resume
        sudo chown some_user:some_group /var/lib/transmission-daemon/info/torrents



      3. Change ownership of other files:



        sudo chown :some_group /etc/transmission-daemon
        sudo chown some_user:some_group /etc/transmission-daemon/settings.json


      Extra Information (updating Transmission):



      Because you changed the default user you may find that after updating Transmission using the repository (eg: apt-get upgrade) the transmission daemon is no longer running.



      Running "sudo apt-get -f install" give the following error:



      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
      1 not fully installed or removed.
      After this operation, 0 B of additional disk space will be used.
      Setting up transmission-daemon (2.84-0ubuntu0.12.04.1) ...
      * Starting bittorrent daemon transmission-daemon
      invoke-rc.d: initscript transmission-daemon, action "start" failed.
      dpkg: error processing transmission-daemon (--configure):
      subprocess installed post-installation script returned error exit status 255
      Errors were encountered while processing:
      transmission-daemon
      E: Sub-process /usr/bin/dpkg returned an error code (1)


      The reason the daemon fails to start ("invoke-rc.d: initscript transmission-daemon, action "start" failed.") is because we changed permissions from "debian-transmission" to "some_user" and after the update these got reset. So to fix just do the following:




      1. Stop Daemon and Edit config file:



        sudo service transmission-daemon stop
        sudo nano /etc/init.d/transmission-daemon


        ...and change USER=some_user to USER=debian-transmission




      2. Re-try fixing update by running:



        sudo apt-get -f install


      3. If the update succeeds the Transmission daemon should now be running. You can now follow steps above to change user/group again.






      share|improve this answer





























        7















        7











        7









        Assumptions:



        • You used this PPA: ppa:transmissionbt/ppa

        • You want to run Transmission with user: some_user and group: some_group

        For System V (SysV) init system (eg: Ubuntu 10.04 LTS):




        1. Stop the Transmission Daemon:



          sudo service transmission-daemon stop



        2. Edit the init.d scripts



          sudo nano /etc/init.d/transmission-daemon


          ...and change USER=debian-transmission to USER=some_user



        For Upstart init system (eg: Ubuntu 14.04 LTS):




        1. Stop the Transmission Daemon:



          sudo service transmission-daemon stop



        2. Edit the init scripts:



          sudo nano /etc/init/transmission-daemon.conf


          ...and edit as follows:



          • change setuid debian-transmission to setuid some_user


          • and change setgid debian-transmission to setgid some_group



        For systemd init system (eg: Ubuntu 16.04 LTS):




        1. Stop the Transmission Daemon:



          sudo systemctl stop transmission-daemon.service



        2. Create systemd override.conf file:



          sudo systemctl edit transmission-daemon.service


          ...and edit as follows:



          [Service]
          User=
          User=some_user
          Group=
          Group=some_group


          Notes:



          • This creates the following file: /etc/systemd/system/transmission-daemon.service.d/override.conf



          • The empty variable assignments (eg: User=) are used to clear/reset the value in the existing variable. This seems to be how things are done when using drop-in replacement of the systemd unit file. See: "Example 2. Overriding vendor settings" in systemd.unit manual:




            "...for drop-in files, if one wants to remove entries from a setting that is parsed as a list (and is not a dependency), ... one needs to first clear the list before re-adding all entries except the one that is to be removed..."






        3. Systemd reload and start transmission daemon:



          sudo systemctl daemon-reload
          sudo systemctl start transmission-daemon.service


          Note: Unlike with Upstart and SysV init systems transmission-daemon saves all configuration and settings in /home/some_user/.config/transmission-daemon/ instead of /etc/transmission-daemon/settings.json and /var/lib/transmission-daemon



        Notes & References



        • /etc/default/transmission-daemon is used only by the Upstart scripts (/etc/init.d/transmission-daemon) and SysV scripts (/etc/init/transmission-daemon.conf) and so if you are using Systemd init system then you can ignore all these files.


        • Running transmission as a user in Ubuntu 16.04


        • Reddit: Changing systemd user with drop-in replacement for transmission-daemon not working


        • Stack-Exchange: Changing systemd user with drop-in replacement for transmission-daemon not working



        Optional/Additional Information regarding permissions and package updates:




        Note: The following is likely only relevant for Upstart and SysV init systems only




        Changing Permissions on Transmission's configuration files



        If you are not using systemd init system you may now need to change the permissions for Transmission's Configuration files from user=debian-transmission to user=some_user and from group=debian-transmission to group=some_group.




        1. Check the location of your Transmission Configuration Directory. You can find it mentioned in the /etc/default/transmission-daemon file as a line like so:



          CONFIG_DIR="/var/lib/transmission-daemon/info"



        2. So assuming your Configuration Directory is /var/lib/transmission-daemon/info, change ownership of configuration files:



          sudo chown some_user:some_group /var/lib/transmission-daemon/downloads
          sudo chown some_user:some_group /var/lib/transmission-daemon/info
          sudo chown some_user:some_group /var/lib/transmission-daemon/info/blocklists
          sudo chown some_user:some_group /var/lib/transmission-daemon/info/dht.dat
          sudo chown some_user:some_group /var/lib/transmission-daemon/info/resume
          sudo chown some_user:some_group /var/lib/transmission-daemon/info/torrents



        3. Change ownership of other files:



          sudo chown :some_group /etc/transmission-daemon
          sudo chown some_user:some_group /etc/transmission-daemon/settings.json


        Extra Information (updating Transmission):



        Because you changed the default user you may find that after updating Transmission using the repository (eg: apt-get upgrade) the transmission daemon is no longer running.



        Running "sudo apt-get -f install" give the following error:



        Reading package lists... Done
        Building dependency tree
        Reading state information... Done
        0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
        1 not fully installed or removed.
        After this operation, 0 B of additional disk space will be used.
        Setting up transmission-daemon (2.84-0ubuntu0.12.04.1) ...
        * Starting bittorrent daemon transmission-daemon
        invoke-rc.d: initscript transmission-daemon, action "start" failed.
        dpkg: error processing transmission-daemon (--configure):
        subprocess installed post-installation script returned error exit status 255
        Errors were encountered while processing:
        transmission-daemon
        E: Sub-process /usr/bin/dpkg returned an error code (1)


        The reason the daemon fails to start ("invoke-rc.d: initscript transmission-daemon, action "start" failed.") is because we changed permissions from "debian-transmission" to "some_user" and after the update these got reset. So to fix just do the following:




        1. Stop Daemon and Edit config file:



          sudo service transmission-daemon stop
          sudo nano /etc/init.d/transmission-daemon


          ...and change USER=some_user to USER=debian-transmission




        2. Re-try fixing update by running:



          sudo apt-get -f install


        3. If the update succeeds the Transmission daemon should now be running. You can now follow steps above to change user/group again.






        share|improve this answer
















        Assumptions:



        • You used this PPA: ppa:transmissionbt/ppa

        • You want to run Transmission with user: some_user and group: some_group

        For System V (SysV) init system (eg: Ubuntu 10.04 LTS):




        1. Stop the Transmission Daemon:



          sudo service transmission-daemon stop



        2. Edit the init.d scripts



          sudo nano /etc/init.d/transmission-daemon


          ...and change USER=debian-transmission to USER=some_user



        For Upstart init system (eg: Ubuntu 14.04 LTS):




        1. Stop the Transmission Daemon:



          sudo service transmission-daemon stop



        2. Edit the init scripts:



          sudo nano /etc/init/transmission-daemon.conf


          ...and edit as follows:



          • change setuid debian-transmission to setuid some_user


          • and change setgid debian-transmission to setgid some_group



        For systemd init system (eg: Ubuntu 16.04 LTS):




        1. Stop the Transmission Daemon:



          sudo systemctl stop transmission-daemon.service



        2. Create systemd override.conf file:



          sudo systemctl edit transmission-daemon.service


          ...and edit as follows:



          [Service]
          User=
          User=some_user
          Group=
          Group=some_group


          Notes:



          • This creates the following file: /etc/systemd/system/transmission-daemon.service.d/override.conf



          • The empty variable assignments (eg: User=) are used to clear/reset the value in the existing variable. This seems to be how things are done when using drop-in replacement of the systemd unit file. See: "Example 2. Overriding vendor settings" in systemd.unit manual:




            "...for drop-in files, if one wants to remove entries from a setting that is parsed as a list (and is not a dependency), ... one needs to first clear the list before re-adding all entries except the one that is to be removed..."






        3. Systemd reload and start transmission daemon:



          sudo systemctl daemon-reload
          sudo systemctl start transmission-daemon.service


          Note: Unlike with Upstart and SysV init systems transmission-daemon saves all configuration and settings in /home/some_user/.config/transmission-daemon/ instead of /etc/transmission-daemon/settings.json and /var/lib/transmission-daemon



        Notes & References



        • /etc/default/transmission-daemon is used only by the Upstart scripts (/etc/init.d/transmission-daemon) and SysV scripts (/etc/init/transmission-daemon.conf) and so if you are using Systemd init system then you can ignore all these files.


        • Running transmission as a user in Ubuntu 16.04


        • Reddit: Changing systemd user with drop-in replacement for transmission-daemon not working


        • Stack-Exchange: Changing systemd user with drop-in replacement for transmission-daemon not working



        Optional/Additional Information regarding permissions and package updates:




        Note: The following is likely only relevant for Upstart and SysV init systems only




        Changing Permissions on Transmission's configuration files



        If you are not using systemd init system you may now need to change the permissions for Transmission's Configuration files from user=debian-transmission to user=some_user and from group=debian-transmission to group=some_group.




        1. Check the location of your Transmission Configuration Directory. You can find it mentioned in the /etc/default/transmission-daemon file as a line like so:



          CONFIG_DIR="/var/lib/transmission-daemon/info"



        2. So assuming your Configuration Directory is /var/lib/transmission-daemon/info, change ownership of configuration files:



          sudo chown some_user:some_group /var/lib/transmission-daemon/downloads
          sudo chown some_user:some_group /var/lib/transmission-daemon/info
          sudo chown some_user:some_group /var/lib/transmission-daemon/info/blocklists
          sudo chown some_user:some_group /var/lib/transmission-daemon/info/dht.dat
          sudo chown some_user:some_group /var/lib/transmission-daemon/info/resume
          sudo chown some_user:some_group /var/lib/transmission-daemon/info/torrents



        3. Change ownership of other files:



          sudo chown :some_group /etc/transmission-daemon
          sudo chown some_user:some_group /etc/transmission-daemon/settings.json


        Extra Information (updating Transmission):



        Because you changed the default user you may find that after updating Transmission using the repository (eg: apt-get upgrade) the transmission daemon is no longer running.



        Running "sudo apt-get -f install" give the following error:



        Reading package lists... Done
        Building dependency tree
        Reading state information... Done
        0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
        1 not fully installed or removed.
        After this operation, 0 B of additional disk space will be used.
        Setting up transmission-daemon (2.84-0ubuntu0.12.04.1) ...
        * Starting bittorrent daemon transmission-daemon
        invoke-rc.d: initscript transmission-daemon, action "start" failed.
        dpkg: error processing transmission-daemon (--configure):
        subprocess installed post-installation script returned error exit status 255
        Errors were encountered while processing:
        transmission-daemon
        E: Sub-process /usr/bin/dpkg returned an error code (1)


        The reason the daemon fails to start ("invoke-rc.d: initscript transmission-daemon, action "start" failed.") is because we changed permissions from "debian-transmission" to "some_user" and after the update these got reset. So to fix just do the following:




        1. Stop Daemon and Edit config file:



          sudo service transmission-daemon stop
          sudo nano /etc/init.d/transmission-daemon


          ...and change USER=some_user to USER=debian-transmission




        2. Re-try fixing update by running:



          sudo apt-get -f install


        3. If the update succeeds the Transmission daemon should now be running. You can now follow steps above to change user/group again.







        share|improve this answer















        share|improve this answer




        share|improve this answer








        edited Sep 27 at 8:02

























        answered Oct 31 '14 at 20:29









        moomoo

        2562 silver badges3 bronze badges




        2562 silver badges3 bronze badges
























            6



















            This is not the complete story. Apart from changing



            setgid <groupname>


            and



            setuid <username>


            in



            /etc/init/transmission-daemon.conf


            you also need to change the permissions of the config file of transmission-daemon. Otherwise it won't be able to rewrite settings to this file and the daemon will restart until upstart thinks it had enough chances (init: transmission-daemon respawning too fast, stopped)



            sudo chown <user>:<group> /etc/transmission-daemon/settings.json
            sudo chown -R <user>:<group> /var/lib/transmission-daemon/





            share|improve this answer



























            • Thanks for the bit about changing the permissions of settings.json. Missed that.

              – nighthawk454
              Mar 27 '17 at 6:12















            6



















            This is not the complete story. Apart from changing



            setgid <groupname>


            and



            setuid <username>


            in



            /etc/init/transmission-daemon.conf


            you also need to change the permissions of the config file of transmission-daemon. Otherwise it won't be able to rewrite settings to this file and the daemon will restart until upstart thinks it had enough chances (init: transmission-daemon respawning too fast, stopped)



            sudo chown <user>:<group> /etc/transmission-daemon/settings.json
            sudo chown -R <user>:<group> /var/lib/transmission-daemon/





            share|improve this answer



























            • Thanks for the bit about changing the permissions of settings.json. Missed that.

              – nighthawk454
              Mar 27 '17 at 6:12













            6















            6











            6









            This is not the complete story. Apart from changing



            setgid <groupname>


            and



            setuid <username>


            in



            /etc/init/transmission-daemon.conf


            you also need to change the permissions of the config file of transmission-daemon. Otherwise it won't be able to rewrite settings to this file and the daemon will restart until upstart thinks it had enough chances (init: transmission-daemon respawning too fast, stopped)



            sudo chown <user>:<group> /etc/transmission-daemon/settings.json
            sudo chown -R <user>:<group> /var/lib/transmission-daemon/





            share|improve this answer
















            This is not the complete story. Apart from changing



            setgid <groupname>


            and



            setuid <username>


            in



            /etc/init/transmission-daemon.conf


            you also need to change the permissions of the config file of transmission-daemon. Otherwise it won't be able to rewrite settings to this file and the daemon will restart until upstart thinks it had enough chances (init: transmission-daemon respawning too fast, stopped)



            sudo chown <user>:<group> /etc/transmission-daemon/settings.json
            sudo chown -R <user>:<group> /var/lib/transmission-daemon/






            share|improve this answer















            share|improve this answer




            share|improve this answer








            edited May 5 '15 at 10:10









            Philippe Gachoud

            3,9471 gold badge28 silver badges42 bronze badges




            3,9471 gold badge28 silver badges42 bronze badges










            answered Jul 14 '13 at 8:25









            mrClassmrClass

            611 silver badge1 bronze badge




            611 silver badge1 bronze badge















            • Thanks for the bit about changing the permissions of settings.json. Missed that.

              – nighthawk454
              Mar 27 '17 at 6:12

















            • Thanks for the bit about changing the permissions of settings.json. Missed that.

              – nighthawk454
              Mar 27 '17 at 6:12
















            Thanks for the bit about changing the permissions of settings.json. Missed that.

            – nighthawk454
            Mar 27 '17 at 6:12





            Thanks for the bit about changing the permissions of settings.json. Missed that.

            – nighthawk454
            Mar 27 '17 at 6:12











            2



















            On systems using systemd, the file you want to edit may actually be:



            /etc/systemd/system/multi-user.target.wants/transmission-daemon.service



            Follow up editing with:



            sudo systemctl daemon-reload






            share|improve this answer



























            • This is what helped me. I did all other steps but didn't work. Thank you!

              – Martijn Smidt
              Dec 26 '15 at 13:20















            2



















            On systems using systemd, the file you want to edit may actually be:



            /etc/systemd/system/multi-user.target.wants/transmission-daemon.service



            Follow up editing with:



            sudo systemctl daemon-reload






            share|improve this answer



























            • This is what helped me. I did all other steps but didn't work. Thank you!

              – Martijn Smidt
              Dec 26 '15 at 13:20













            2















            2











            2









            On systems using systemd, the file you want to edit may actually be:



            /etc/systemd/system/multi-user.target.wants/transmission-daemon.service



            Follow up editing with:



            sudo systemctl daemon-reload






            share|improve this answer
















            On systems using systemd, the file you want to edit may actually be:



            /etc/systemd/system/multi-user.target.wants/transmission-daemon.service



            Follow up editing with:



            sudo systemctl daemon-reload







            share|improve this answer















            share|improve this answer




            share|improve this answer








            edited Jun 3 '16 at 6:59

























            answered Sep 12 '15 at 15:15









            EpskampieEpskampie

            5203 silver badges6 bronze badges




            5203 silver badges6 bronze badges















            • This is what helped me. I did all other steps but didn't work. Thank you!

              – Martijn Smidt
              Dec 26 '15 at 13:20

















            • This is what helped me. I did all other steps but didn't work. Thank you!

              – Martijn Smidt
              Dec 26 '15 at 13:20
















            This is what helped me. I did all other steps but didn't work. Thank you!

            – Martijn Smidt
            Dec 26 '15 at 13:20





            This is what helped me. I did all other steps but didn't work. Thank you!

            – Martijn Smidt
            Dec 26 '15 at 13:20











            2



















            In Ubuntu 16.04 the startup service was changed from upstart to systemd, making must of the previous answers obsolete. To change the user transmission-daemon runs execute:



            Stop daemon:



            sudo service transmission-daemon stop


            Change ownership of configuration files and "home":



            sudo chown -R USER:USER /var/lib/transmission-daemon/*
            sudo chown -R USER:USER /etc/transmission-daemon/settings.json


            Then edit file /lib/systemd/system/transmission-daemon.service with:



            [Unit]
            Description=Transmission BitTorrent Daemon
            After=network.target

            [Service]
            User=USER
            Type=notify
            ExecStart=/usr/bin/transmission-daemon -f --log-debug --config-dir /var/lib/transmission-daemon/info
            ExecReload=/bin/kill -s HUP $MAINPID

            [Install]
            WantedBy=multi-user.target


            Please note the User, --config-dirand the --log-debug changes.



            Reload systemd configuration:



            sudo systemctl daemon-reload


            Start daemon again:



            sudo service transmission-daemon start


            Once you have set the --log-debug (which will give you more information of any issue) option you can get the daemon's log:



            sudo journalctl -u transmission-daemon.service


            Done.



            Things to note:



            You can ignore files:



            /etc/default/transmission-daemon: It seems that nobody is sourcing it in systemd systems.



            /etc/init.d/transmission-daemon: It seems that this was the old system 5 start script.



            /etc/init/transmission-daemon.conf: It seems that this is the old upstart start script.






            share|improve this answer




















            • 2





              Do not edit /lib/systemd/system/transmission-daemon.service manually. Use systemctl edit transmission-daemon.service instead, or your changes will be lost when you upgrade the package.

              – muru
              Jan 9 '17 at 7:30















            2



















            In Ubuntu 16.04 the startup service was changed from upstart to systemd, making must of the previous answers obsolete. To change the user transmission-daemon runs execute:



            Stop daemon:



            sudo service transmission-daemon stop


            Change ownership of configuration files and "home":



            sudo chown -R USER:USER /var/lib/transmission-daemon/*
            sudo chown -R USER:USER /etc/transmission-daemon/settings.json


            Then edit file /lib/systemd/system/transmission-daemon.service with:



            [Unit]
            Description=Transmission BitTorrent Daemon
            After=network.target

            [Service]
            User=USER
            Type=notify
            ExecStart=/usr/bin/transmission-daemon -f --log-debug --config-dir /var/lib/transmission-daemon/info
            ExecReload=/bin/kill -s HUP $MAINPID

            [Install]
            WantedBy=multi-user.target


            Please note the User, --config-dirand the --log-debug changes.



            Reload systemd configuration:



            sudo systemctl daemon-reload


            Start daemon again:



            sudo service transmission-daemon start


            Once you have set the --log-debug (which will give you more information of any issue) option you can get the daemon's log:



            sudo journalctl -u transmission-daemon.service


            Done.



            Things to note:



            You can ignore files:



            /etc/default/transmission-daemon: It seems that nobody is sourcing it in systemd systems.



            /etc/init.d/transmission-daemon: It seems that this was the old system 5 start script.



            /etc/init/transmission-daemon.conf: It seems that this is the old upstart start script.






            share|improve this answer




















            • 2





              Do not edit /lib/systemd/system/transmission-daemon.service manually. Use systemctl edit transmission-daemon.service instead, or your changes will be lost when you upgrade the package.

              – muru
              Jan 9 '17 at 7:30













            2















            2











            2









            In Ubuntu 16.04 the startup service was changed from upstart to systemd, making must of the previous answers obsolete. To change the user transmission-daemon runs execute:



            Stop daemon:



            sudo service transmission-daemon stop


            Change ownership of configuration files and "home":



            sudo chown -R USER:USER /var/lib/transmission-daemon/*
            sudo chown -R USER:USER /etc/transmission-daemon/settings.json


            Then edit file /lib/systemd/system/transmission-daemon.service with:



            [Unit]
            Description=Transmission BitTorrent Daemon
            After=network.target

            [Service]
            User=USER
            Type=notify
            ExecStart=/usr/bin/transmission-daemon -f --log-debug --config-dir /var/lib/transmission-daemon/info
            ExecReload=/bin/kill -s HUP $MAINPID

            [Install]
            WantedBy=multi-user.target


            Please note the User, --config-dirand the --log-debug changes.



            Reload systemd configuration:



            sudo systemctl daemon-reload


            Start daemon again:



            sudo service transmission-daemon start


            Once you have set the --log-debug (which will give you more information of any issue) option you can get the daemon's log:



            sudo journalctl -u transmission-daemon.service


            Done.



            Things to note:



            You can ignore files:



            /etc/default/transmission-daemon: It seems that nobody is sourcing it in systemd systems.



            /etc/init.d/transmission-daemon: It seems that this was the old system 5 start script.



            /etc/init/transmission-daemon.conf: It seems that this is the old upstart start script.






            share|improve this answer














            In Ubuntu 16.04 the startup service was changed from upstart to systemd, making must of the previous answers obsolete. To change the user transmission-daemon runs execute:



            Stop daemon:



            sudo service transmission-daemon stop


            Change ownership of configuration files and "home":



            sudo chown -R USER:USER /var/lib/transmission-daemon/*
            sudo chown -R USER:USER /etc/transmission-daemon/settings.json


            Then edit file /lib/systemd/system/transmission-daemon.service with:



            [Unit]
            Description=Transmission BitTorrent Daemon
            After=network.target

            [Service]
            User=USER
            Type=notify
            ExecStart=/usr/bin/transmission-daemon -f --log-debug --config-dir /var/lib/transmission-daemon/info
            ExecReload=/bin/kill -s HUP $MAINPID

            [Install]
            WantedBy=multi-user.target


            Please note the User, --config-dirand the --log-debug changes.



            Reload systemd configuration:



            sudo systemctl daemon-reload


            Start daemon again:



            sudo service transmission-daemon start


            Once you have set the --log-debug (which will give you more information of any issue) option you can get the daemon's log:



            sudo journalctl -u transmission-daemon.service


            Done.



            Things to note:



            You can ignore files:



            /etc/default/transmission-daemon: It seems that nobody is sourcing it in systemd systems.



            /etc/init.d/transmission-daemon: It seems that this was the old system 5 start script.



            /etc/init/transmission-daemon.conf: It seems that this is the old upstart start script.







            share|improve this answer













            share|improve this answer




            share|improve this answer










            answered Dec 17 '16 at 2:28









            Carolina AguilarCarolina Aguilar

            1212 bronze badges




            1212 bronze badges










            • 2





              Do not edit /lib/systemd/system/transmission-daemon.service manually. Use systemctl edit transmission-daemon.service instead, or your changes will be lost when you upgrade the package.

              – muru
              Jan 9 '17 at 7:30












            • 2





              Do not edit /lib/systemd/system/transmission-daemon.service manually. Use systemctl edit transmission-daemon.service instead, or your changes will be lost when you upgrade the package.

              – muru
              Jan 9 '17 at 7:30







            2




            2





            Do not edit /lib/systemd/system/transmission-daemon.service manually. Use systemctl edit transmission-daemon.service instead, or your changes will be lost when you upgrade the package.

            – muru
            Jan 9 '17 at 7:30





            Do not edit /lib/systemd/system/transmission-daemon.service manually. Use systemctl edit transmission-daemon.service instead, or your changes will be lost when you upgrade the package.

            – muru
            Jan 9 '17 at 7:30











            0



















            I did the following, which to me seems less invasive than the other answers.




            1. Remove the startup of transmission-daemon:



              sudo update-rc.d -f transmission-daemon remove



            2. Add the following to /etc/profile:



              if [ -f "$HOME/.autostart" ]; then
              $HOME/.autostart
              fi



            3. Create ~/.autostart:



              #!/bin/bash
              if [ -z "$(pidof transmission-daemon)" ]; then
              /usr/bin/transmission-daemon --config-dir /home/[USERNAME]/.config/transmission-daemon &
              fi


            This is a bit more portable perhaps, it works for me on plain Debian and minibian too.






            share|improve this answer

























            • not a bad idea but it requires that the user logins with a shell that executes /etc/profile (zsh doesn't execute it, for example)

              – elboletaire
              Oct 11 '15 at 9:19















            0



















            I did the following, which to me seems less invasive than the other answers.




            1. Remove the startup of transmission-daemon:



              sudo update-rc.d -f transmission-daemon remove



            2. Add the following to /etc/profile:



              if [ -f "$HOME/.autostart" ]; then
              $HOME/.autostart
              fi



            3. Create ~/.autostart:



              #!/bin/bash
              if [ -z "$(pidof transmission-daemon)" ]; then
              /usr/bin/transmission-daemon --config-dir /home/[USERNAME]/.config/transmission-daemon &
              fi


            This is a bit more portable perhaps, it works for me on plain Debian and minibian too.






            share|improve this answer

























            • not a bad idea but it requires that the user logins with a shell that executes /etc/profile (zsh doesn't execute it, for example)

              – elboletaire
              Oct 11 '15 at 9:19













            0















            0











            0









            I did the following, which to me seems less invasive than the other answers.




            1. Remove the startup of transmission-daemon:



              sudo update-rc.d -f transmission-daemon remove



            2. Add the following to /etc/profile:



              if [ -f "$HOME/.autostart" ]; then
              $HOME/.autostart
              fi



            3. Create ~/.autostart:



              #!/bin/bash
              if [ -z "$(pidof transmission-daemon)" ]; then
              /usr/bin/transmission-daemon --config-dir /home/[USERNAME]/.config/transmission-daemon &
              fi


            This is a bit more portable perhaps, it works for me on plain Debian and minibian too.






            share|improve this answer














            I did the following, which to me seems less invasive than the other answers.




            1. Remove the startup of transmission-daemon:



              sudo update-rc.d -f transmission-daemon remove



            2. Add the following to /etc/profile:



              if [ -f "$HOME/.autostart" ]; then
              $HOME/.autostart
              fi



            3. Create ~/.autostart:



              #!/bin/bash
              if [ -z "$(pidof transmission-daemon)" ]; then
              /usr/bin/transmission-daemon --config-dir /home/[USERNAME]/.config/transmission-daemon &
              fi


            This is a bit more portable perhaps, it works for me on plain Debian and minibian too.







            share|improve this answer













            share|improve this answer




            share|improve this answer










            answered May 15 '15 at 21:15









            nicholas.alipaznicholas.alipaz

            1314 bronze badges




            1314 bronze badges















            • not a bad idea but it requires that the user logins with a shell that executes /etc/profile (zsh doesn't execute it, for example)

              – elboletaire
              Oct 11 '15 at 9:19

















            • not a bad idea but it requires that the user logins with a shell that executes /etc/profile (zsh doesn't execute it, for example)

              – elboletaire
              Oct 11 '15 at 9:19
















            not a bad idea but it requires that the user logins with a shell that executes /etc/profile (zsh doesn't execute it, for example)

            – elboletaire
            Oct 11 '15 at 9:19





            not a bad idea but it requires that the user logins with a shell that executes /etc/profile (zsh doesn't execute it, for example)

            – elboletaire
            Oct 11 '15 at 9:19


















            draft saved

            draft discarded















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f261252%2fhow-do-i-change-the-user-transmission-runs-under%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown









            Popular posts from this blog

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?