Change daemon user
Change daemon user
I've just upgraded my Ubuntu distro from 12.04 LTS to 13.04. After the upgrade, I realized that transmission-daemon is now running as the user "debian-transmission", and not as the user "joachim" that I wanted it to run as.
I looked in the init.d/transmission-daemon, but can't find the USER variable anymore. I tried to create it, but it doesn't seem to work.
Is it possible to run transmission as another user in Ubuntu 13.04?
Thank you for your time,
Joachim
-
- Posts: 552
- Joined: Sun Dec 13, 2009 10:44 pm
Re: Change daemon user
Anyway, if they still use an init-script for Transmission then technically it is still be possible but maybe not as straightforward as it was before. I believe Ubuntu (and other .deb based distros) use the /etc/default(s) directory for user supplied config changes to init-scripts, it should source it from the init-script so look for a line that starts with either "source" or just a dot and then a file under /etc/<some folder>.
By the way, this is an issue with Ubuntu them self since they are the ones who put together that specific package and the init-script in it, not the Transmission devs.
Re: Change daemon user
1. Stop transmission:
Code: Select all
sudo service transmission-daemon stop
Code: Select all
sudo gedit /etc/init/transmission-daemon.conf
Code: Select all
setuid debian-transmission
Code: Select all
ssetuid USER
Code: Select all
sudo chown USER:USER settings.json*
Code: Select all
sudo chown -R USER:USER /var/lib/transmission-daemon/downloads
Code: Select all
sudo chown -R USER:USER /var/lib/transmission-daemon/info
Code: Select all
sudo service transmission-daemon start
-
- Posts: 552
- Joined: Sun Dec 13, 2009 10:44 pm
Re: Change daemon user
I would actually do:DaftHonk wrote:3. Change ownership of the settings.json file and the contents of /var/lib/transmission-daemon:Code: Select all
sudo chown USER:USER settings.json*
Code: Select all
sudo chown -R USER:USER /var/lib/transmission-daemon/downloads
Code: Select all
sudo chown -R USER:USER /var/lib/transmission-daemon/info
Code: Select all
sudo chown -R USER:USER /var/lib/transmission-daemon
Re: Change daemon user
Here's the thing, transmission never created the "transmission-daemon.conf" file. I thought that maybe they changed the file location so I searched my entire system for it, and nothing came up.
Code: Select all
/etc/init/transmission-daemon.conf
Code: Select all
NAME=transmission-daemon
DAEMON=/usr/bin/$NAME
USER=joe
STOP_TIMEOUT=30
Re: Change daemon user
I hope this helps! I'm on Ubuntu 16.04 LTS
Re: Change daemon user
debian and ubuntu users need to edit /lib/systemd/system/transmission-daemon.service and the config file will be read from ~/.config/transmission-daemon/
-
- Posts: 2
- Joined: Tue Jan 02, 2018 5:12 pm
Re: Change daemon user
How to change the Transmission daemon's username
0) Elevate your login to sudo
Code: Select all
sudo -i
1) Stop the Transmission service from running in the background. Otherwise, these edits won't stick.
Code: Select all
service transmission-daemon stop
Code: Select all
nano /etc/init.d/transmission-daemon
Code: Select all
USER=debian-transmission
3) Edit 2nd init Transmission configuration file.
Code: Select all
nano /etc/init/transmission-daemon.conf
Code: Select all
setuid debian-transmission
setgid debian-transmission
Code: Select all
nano /lib/systemd/system/transmission-daemon.service
Code: Select all
[Service]
User=debian-transmission
Code: Select all
ls /etc/trans* -lh
Code: Select all
drwxrwsr-x 2 debian-transmission vpn 4.0K Jan 2 10:18 transmission-daemon
Code: Select all
ls /etc/transmission-daemon -lh
Code: Select all
total 8.0K
-rw-r--r-- 1 debian-transmission debian-transmission 303 Feb 20 2017 README.json
-rw------- 1 debian-transmission debian-transmission 2.4K Jan 2 10:18 settings.json
Code: Select all
chown debian-transmission:debian-transmission /etc/transmission-daemon -R
Now check the library file permissions:
Code: Select all
ls /var/lib/transmission-daemon -lhR
Code: Select all
chown debian-transmission:debian-transmission /var/lib/transmission-daemon -R
Code: Select all
reboot
Code: Select all
sudo service transmission-daemon status
Code: Select all
●transmission-daemon.service - Transmission BitTorrent Daemon
Loaded: loaded (/lib/systemd/system/transmission-daemon.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-01-02 10:18:01 CST; 1min 54s ago
Main PID: 1101 (transmission-da)
Status: "Idle."
Tasks: 4
Memory: 1.1M
CPU: 42ms
CGroup: /system.slice/transmission-daemon.service
└─1101 /usr/bin/transmission-daemon -f --log-error
Jan 02 10:18:00 mediaserver systemd[1]: Starting Transmission BitTorrent Daemon...
Jan 02 10:18:01 mediaserver systemd[1]: Started Transmission BitTorrent Daemon.
If the daemon is not active, you made a mistake in one of the configuration files.
Here's another way to verify the user running the daemon process:
Code: Select all
ps -ef | egrep '(transmission)' | grep -v `whoami` | grep -v root | head -n1 | awk '{print $1}'
Code: Select all
debian-+
PLEASE NOTE if you change the Transmission username, any subsequent files downloaded by Transmission will be owned by the new user and its primary group ID. You will need to take that into consideration and at the very least you'll want to be certain other processes (e.g. Sonarr) are able to access and manipulate the downloaded files. Don't forget to set file and directory permissions of Transmission's download directories to restrict access by group (e.g. 755 or 775), and ensure other programs you want to be capable of manipulating Transmission files are also a member of the Transmission daemon's new primary group id. They don't need to have their primary group ID changed. Simply add those users to the same group but as secondary group members. This can be accomplished easily via the Webmin GUI.
-
- Posts: 2
- Joined: Tue Jan 02, 2018 5:12 pm
Re: Change daemon user
Code: Select all
service transmission-daemon restart
Code: Select all
service transmission-daemon start
-
- Posts: 1
- Joined: Tue Jan 16, 2018 6:06 pm
Re: Change daemon user
Code: Select all
Jan 16 18:04:20 raspberrypi systemd[1]: Starting Transmission BitTorrent Daemon...
Jan 16 18:04:20 raspberrypi systemd[1]: Started Transmission BitTorrent Daemon.
Jan 16 18:04:21 raspberrypi transmission-daemon[1415]: [2018-01-16 18:04:21.983] UDP Failed to
Jan 16 18:04:21 raspberrypi transmission-daemon[1415]: [2018-01-16 18:04:21.984] UDP Failed to
Code: Select all
403: Forbidden
Unauthorized IP Address.
Either disable the IP address whitelist or add your address to it.
If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.
If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details.
Code: Select all
"rpc-password": "raspberry",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "pi",
"rpc-whitelist": "*.*.*.*",
"rpc-whitelist-enabled": true,
"scrape-paused-torrents-enabled": true,
"script-torrent-done-enabled": false,
"script-torrent-done-filename": "",
"seed-queue-enabled": false,
"seed-queue-size": 10,
"speed-limit-down": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"start-added-torrents": true,
"trash-original-torrent-files": false,
"umask": 2,
"upload-limit": 100,
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 14,
"utp-enabled": true
}
Re: Change daemon user
I am really getting tired with this, every couple of months, version change, nothing works and we need to dig into all these things that I care not to memorize and have to dig the forums every time...
Also the answers are really really slow...
Very dissappointed...
Re: Change daemon user
your settings.json file is owned and readble only by the old user (debian-transmission)
Change permissions for the new user you assigned and everything will be back to normal.
Re: Change daemon user
Re: Change daemon user
Can't be arsed anymore. Too tired. Most probably going to deluge...
Re: Change daemon user
How I did get it to work:
Code: Select all
# vipw
1. Make sure the user 'debian-transmission' does not exist (I had deleted it);
2. Duplicate the user that you want transmission-daemon to use (in my case: 'transmission');
3. Rename the duplicate's username to 'debian-transmission'.
Code: Select all
transmission:x:128:139::/var/lib/transmission-daemon:/bin/false
debian-transmission:x:128:139::/var/lib/transmission-daemon:/bin/false
Code: Select all
# vipw -s