How do you set a password for transmission-daemon, the BitTorrent client server?

205,495

Solution 1

Do these things in the exact order:

  1. Shutdown: /etc/init.d/transmission-daemon stop
  2. Write the rpc-password in the /etc/transmission-daemon/settings.json file, in double-quotes. Make sure rpc-authentication-required is true.
  3. Save that file
  4. Startup: /etc/init.d/transmission-daemon start
  5. Login to the page, it's at port 9091
  6. Type in your password.

The password that's being overwritten is a hash. The program is smarter than usual and detects that your password is not a hash, so it overwrites the password with the hash to be secure. So your password should work.

However, remember that it writes the password it loaded with when it shuts down. So doing /etc/init.d/transmission-daemon restart will not do what you expect if you've written the file while it's running.

Solution 2

Genrally the daemon writes its settings when it exits (or is restarted). You can force the daemon to reload new settings by sending it SIGHUP:

kill -HUP 1234

...then it will not overwrite your settings anymore when stopping.

BTW: I'm not happy that transmission-remote-cli wants to have the password on the command line. Bad idea!

Solution 3

You can also try another solution to find the password:

ps -ef | grep transmission

(to my version it was admin:password1)

Solution 4

While this post already has an accepted answer, I find it worth adding that in Ubuntu the transmission-daemon is actually not stoppable once started.

This means that any changes you do to settings.json will get overwritten on next restart, whenever that is.

This also means that you have to completely disable daemon-startup on boot, reboot, edit your settings.json and then re-enabling it to make the changes you do persist.

Pretty annoying, but once you're aware of what's going on, it's fairly easy to cope.

Share:
205,495

Related videos on Youtube

Neil
Author by

Neil

Updated on September 17, 2022

Comments

  • Neil
    Neil almost 2 years

    The config file is ambiguous, and keeps getting overwritten when you restart the daemon in Debian, anyway.

    In /etc/transmission-daemon/settings.json, there are these options:

    rpc-username
    rpc-password
    proxy-auth-username
    proxy-auth-password
    

    Every time I restart the daemon with:

    /etc/init.d/transmission-daemon restart
    

    It overwrites rpc-password, and the password it prints doesn't work anyway.

    Does anyone know how to set the password properly? I don't want to disable it.

    • robmathers
      robmathers about 9 years
      Just putting this here for anyone who might come across it in the future, but you also have to set rpc-authentication-required to true in the settings file, otherwise Transmission won't check for a password.
    • Kalle Richter
      Kalle Richter about 7 years
      I reported this behaviour because it's non constructive at bugs.launchpad.net/ubuntu/+source/transmission/+bug/1644091, but it's been ignored as so many Ubuntu bugs.
  • brad
    brad almost 13 years
    You don't have to stop and restart the daemon. Just /etc/init.d/transmission-daemon reload.
  • yar
    yar about 12 years
    init.d/reload is distro-specific. More generally, you just send a SIGHUP - although this is NOT in the man page, only here: trac.transmissionbt.com/wiki/EditConfigFiles
  • terdon
    terdon about 11 years
    Comment from an anonymous user: In my case, there was a script (in /etc/init.d) to launch the daemon that passed it the password: I had to edit that script (named "transmissiond") to change password and so it worked.
  • Damon Smith
    Damon Smith over 9 years
    When you say not stoppable, did you try running: "sudo service transmission-daemon stop" ? to stop it in the usual way? That works for me. Then you can edit the settings file and restart it.
  • Damon Smith
    Damon Smith over 9 years
    In my ubuntu install at least, the password is set in the file so listing the processes won't tell you what the password is.
  • user3763403
    user3763403 about 9 years
    -1, This is just plain incorrect. @Neil method works as described and if what you said was true his method would not work. The settings.json file only gets over written if you modify it while transmission is running then restart transmission.
  • Jostein Kjønigsen
    Jostein Kjønigsen about 9 years
    If you do what the clear majority of users with a sysv-style init-background does instinctively ( /etc/init.d/transmission restart ) it does indeed not work. If you have to do some weird "service" thing or upstart-thing or another special Ubuntu-ism to make it work, then it by definition doesn't work.
  • suriv
    suriv about 9 years
    "Doesn't work the way I'm used to" is not the same as "doesn't work". It works.
  • Kalle Richter
    Kalle Richter about 7 years
    Overwriting a configuration file in this way is either smart or not, it's definitely a good source for unnecessary trouble (in comparison to just forcing the user to write hashs in the configuration file and provide useful feedback on every level). I tried to get transmission running for some years now and documented the attempts. Usually other fields get overwritten as well. I filed some bugs about it which have been ignored.
  • Sunil Biswakarma
    Sunil Biswakarma over 5 years
    Note: you may have to change rpc-authentication-required to true
  • Admin
    Admin about 2 years
    @brad On ubuntu using systemctl restart rewrites the config file, so I had to stop, set password, and start