Running as non-root
Hi,
Is there any way/information on how to run the TwonyServer in linux as non-root user?
Regards,
divB
Is there any way/information on how to run the TwonyServer in linux as non-root user?
Regards,
divB
- parnott
- Posts:326
- Joined:Mon Sep 20, 2010 9:55 pm
- AV Hardware:Twonky, WDTV Live, XBMC (Linux & Windows)
Re: Running as non-root
No, not that I I know of. And, for what specific reason do you want to do this?
Re: Running as non-root
Hello,
Hmmm
For security purposes. Running such a process as root is really dangerous.
Although running in the own network...
Regards,
divB
Hmmm

For security purposes. Running such a process as root is really dangerous.
Although running in the own network...
Regards,
divB
- parnott
- Posts:326
- Joined:Mon Sep 20, 2010 9:55 pm
- AV Hardware:Twonky, WDTV Live, XBMC (Linux & Windows)
Re: Running as non-root
And who exactly do you think is going breach your security? Your wife, your kids...divB wrote:Hello,
Hmmm
For security purposes. Running such a process as root is really dangerous.
Although running in the own network...
Regards,
divB
Running processes as root is not dangerous on your local network. Now, if you have a completely unsecured network or system then yes it is and you need to fix it.
Re: Running as non-root
Hi,
If this would be the case then there would be no need for UIDs != 0 and we're back to Windows 9x.
For example, Twonky could have a security flaw which can be used by other malware on the same server/network in order to gain root privileges.
Maybe I will just try to run as non-privileged user. I have access to media files to unprivileged users via ACLs. I think there is nothing more which really needs root privileged.
Regards,
divB
If this would be the case then there would be no need for UIDs != 0 and we're back to Windows 9x.
For example, Twonky could have a security flaw which can be used by other malware on the same server/network in order to gain root privileges.
Maybe I will just try to run as non-privileged user. I have access to media files to unprivileged users via ACLs. I think there is nothing more which really needs root privileged.
Regards,
divB
Re: Running as non-root
Any luck?
Re: Running as non-root
I think it shouldnt be a problem but i didnt try.
Im still running as root
Im still running as root
Re: Running as non-root
I got this to work by running these commands.
sudo /etc/init.d/twonkyserver stop
sudo rm /tmp/TwonkyMediaServer-log.txt
#edited to force homedir to twonky location
sudo adduser twonky --home /usr/local/twonkymedia
sudo chown -R twonky:twonky /var/twonkymedia
sudo chown -R twonky:twonky /usr/local/twonkymedia
# I haven't changed my config, but this is stupid that
# twonky creates a directory at the root of your drive
# it should be created in /usr/local/twonkymedia/fooo
sudo chown -R twonky:twonky /twonkymedia
sudo sed -i.bak 's/"\$TWONKYSRV" -D/su twonky -c "\$TWONKYSRV -D"/g' /etc/init.d/twonkyserver
sudo /etc/init.d/twonkyserver start
sudo /etc/init.d/twonkyserver stop
sudo rm /tmp/TwonkyMediaServer-log.txt
#edited to force homedir to twonky location
sudo adduser twonky --home /usr/local/twonkymedia
sudo chown -R twonky:twonky /var/twonkymedia
sudo chown -R twonky:twonky /usr/local/twonkymedia
# I haven't changed my config, but this is stupid that
# twonky creates a directory at the root of your drive
# it should be created in /usr/local/twonkymedia/fooo
sudo chown -R twonky:twonky /twonkymedia
sudo sed -i.bak 's/"\$TWONKYSRV" -D/su twonky -c "\$TWONKYSRV -D"/g' /etc/init.d/twonkyserver
sudo /etc/init.d/twonkyserver start
Last edited by sstodola on Tue Jun 07, 2011 4:44 am, edited 2 times in total.
Re: Running as non-root
I do have something odd going on where /usr/local/twonkymedia/twonkymediaserver -D is restarting every 10 minutes or so, but it isn't affecting streaming to my xbox
Re: Running as non-root
I've edited the set of commands so that it should work. I haven't had an auto restart in 2 hours now.