You are not logged in.

#1 2008-01-28 16:45:26

manmower
Member
From: Belgium
Registered: 2006-11-17
Posts: 100

Questions regarding processes run as root

Poking around in htop today I saw a few processes being run by root where I'm not sure they really need to be. This is probably a stupid question, but I was wondering whether or not this is problematic and if anything can/needs to be done about it.

Most notably X. I start it by logging in at the console as normal user and running startx (aliased to exec startx). This results in /usr/bin/X being run as root, apparently. I'm not sure if this is an issue. I do use the '-nolisten tcp' option, by the way.

Other processes that perhaps don't need to be run as root are lastfmsubmitd, lastmp and ntpd. Again I don't know if there are any dangers in running these as root, or if there is a way to run them as a normal user.

Can anyone shine their light on these?

Thanks.

Offline

#2 2008-02-01 02:20:57

manmower
Member
From: Belgium
Registered: 2006-11-17
Posts: 100

Re: Questions regarding processes run as root

Reluctantly bumping this, to see if anyone has anything to say yet. I'm guessing X being run as root is probably normal? I'd still be interested in how to run daemons (other than mpd) as a user though.

Offline

#3 2008-02-01 02:39:46

elliott
Member
Registered: 2006-03-07
Posts: 296

Re: Questions regarding processes run as root

X does need root privileges. I'd expect ntpd to need root privileges to be able to set the time. For the others, I am not familiar with them, try starting them without the init script as a normal user. If they run fine, modify the init script to run them as a normal user with su.

Offline

#4 2008-02-01 03:01:06

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: Questions regarding processes run as root

Hey, my X runs as root too! Weird... how do I revoke it those privileges?

Offline

#5 2008-02-01 03:27:41

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: Questions regarding processes run as root

Xorg is setuid root. I don't know why or if it has to be... Maybe you can try unsetting it (chmod u-s /usr/bin/Xorg), see if it still works (probably not), and then setting it back (chmod u+s /usr/bin/Xorg).
I'm not 100% sure about this, never used setuid before.

Offline

#6 2008-02-01 04:00:48

Shaika-Dzari
Member
From: Québec, Canada
Registered: 2006-04-14
Posts: 436
Website

Re: Questions regarding processes run as root

Hello!

/usr/bin/Xorg requires root permissions because the program needs direct access to the hardware (video card).

@+

Offline

Board footer

Powered by FluxBB