QBittorrent - Change User

Status
Not open for further replies.

JTBTek

Dabbler
Joined
Dec 1, 2018
Messages
32
I'm running FN 11.2-RC2

I installed QBittorent using the plugin section in FN. I notice that QBittorent is ran as root. I really need it to run as some other user. I have done some searching both here and google, and the closest I have found was a post here in the forum. But it didn't offer any real result that I could see.

Running "top" inside the jail results:
Code:

  PID USERNAME	 THR PRI NICE   SIZE	RES STATE   C   TIME	WCPU COMMAND
 4595 root		  11  20	0   134M 71684K select  3   0:12   0.16% qbittorrent-nox
 4579 root		   1  20	0 10288K  6308K select  8   0:02   0.02% openvpn



To give a little more info, my purpose for the need to change the user is for IPFW rules to function as my VPN kill switch. I had this setup and working perfectly till Transmission quit downloading.

For reference here is the IPFW rules I was using:
Code:

#!/bin/bash

# Flush out the list before we begin

ipfw -q -f flush

# Set rules command prefix

cmd="ipfw -q add"

vpn="tun0"

# allow all local traffic on the loopback interface

$cmd 00001 allow all from any to any via lo0

# allow any connection to/from VPN interface

$cmd 00010 allow all from any to any via $vpn

# allow connection to/from LAN by Transmission

$cmd 00101 allow all from me to 192.168.0.0/24 uid transmission

$cmd 00102 allow all from 192.168.0.0/24 to me uid transmission

# deny any Transmission connection outside LAN that does not use VPN

$cmd 00103 deny all from any to any uid transmission




If someone could assist with either changing the user that QBittorrent runs as, or maybe even an alternative kill switch option. Thanks in advance.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Inside the jail take a look in /usr/local/etc/rc.d/ you should find the startup script with a variable or the user.
 

JTBTek

Dabbler
Joined
Dec 1, 2018
Messages
32
No. I never could get it to work. I ended up switching back to transmission. Every time I was able to get qbittorrent to open as a different user, it was unusable, not even the web GUI would open. If sure if i would have chown(ed) the main directories it might have worked, but it was becoming to much work.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Depending on how qbittorrent works, it may NEED to run as root. i.e. uses "privileged" ports like port 80. etc..
 

JTBTek

Dabbler
Joined
Dec 1, 2018
Messages
32
Inside the jail take a look in /usr/local/etc/rc.d/ you should find the startup script with a variable or the user.

That is one of the methods I tried, using:
iocage exec qbittorent sysrc 'qbittorrent_user=media'

I
Depending on how qbittorrent works, it may NEED to run as root. i.e. uses "privileged" ports like port 80. etc..

I belive this is the case for qBittorrent.
 

JTBTek

Dabbler
Joined
Dec 1, 2018
Messages
32
The good news is transmission has been working flawlessly and my IPFW rules are stopping only transmission traffic.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
try find / -name rc.local and see if that has any reference to qbittorrent-nox. Sometimes the rc file will pass vars to the startup script for the service.
 
Status
Not open for further replies.
Top