Page 1 of 1
Running as non-root
Posted: Fri Apr 29, 2011 5:51 pm
by divB
Hi,
Is there any way/information on how to run the TwonyServer in linux as non-root user?
Regards,
divB
Re: Running as non-root
Posted: Fri Apr 29, 2011 7:52 pm
by parnott
No, not that I I know of. And, for what specific reason do you want to do this?
Re: Running as non-root
Posted: Fri Apr 29, 2011 8:19 pm
by divB
Hello,
Hmmm
For security purposes. Running such a process as root is really dangerous.
Although running in the own network...
Regards,
divB
Re: Running as non-root
Posted: Fri Apr 29, 2011 8:36 pm
by parnott
divB wrote:Hello,
Hmmm
For security purposes. Running such a process as root is really dangerous.
Although running in the own network...
Regards,
divB
And who exactly do you think is going breach your security? Your wife, your kids...
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
Posted: Fri Apr 29, 2011 8:57 pm
by divB
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
Re: Running as non-root
Posted: Tue May 17, 2011 12:49 am
by sstodola
Any luck?
Re: Running as non-root
Posted: Wed May 18, 2011 6:21 pm
by divB
I think it shouldnt be a problem but i didnt try.
Im still running as root
Re: Running as non-root
Posted: Tue May 24, 2011 3:51 am
by sstodola
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
Re: Running as non-root
Posted: Tue May 24, 2011 5:08 pm
by sstodola
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
Posted: Wed May 25, 2011 6:58 am
by sstodola
I've edited the set of commands so that it should work. I haven't had an auto restart in 2 hours now.