LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-18-2003, 09:20 AM   #1
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Apache User?


Hello all. I've heard that you should not have many services running as root especially apache because you can become rooted. When I issue a top command it shows the user of apache as root. In my httpd.conf it shows the user and group as apache. Why does the top command show root as the user of a lot of services running? Is this normal or is something messed up here?
 
Old 02-18-2003, 01:06 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Well, for one since certain capabilities (privileges) are bound to the "root" user, like being able to bind to ports below 1024. In your example, to be able to bind to port 80/TCP httpd has to be started as root. After the socket is set up and the socket bound to port 80/TCP, httpd will fork off "worker" threads to handle incoming connetcions etc etc.

Try running "ps" again, for instance as "/bin/ps ax -eo uid,euid,gid,egid,pid,args f". Showing output in "forest mode" prefixed with (e)uid/gid stuff. You should see the "main" httpd thread running as uid/gid root and the "worker" threads as the apache uid/gid.
The "main" thread doesn't interface with the network or users but instead delegates worker threads to do fulfill those tasks.
 
Old 02-19-2003, 07:53 AM   #3
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Original Poster
Rep: Reputation: 57
Thanks unSpawn. I got a little paranoid but you've calmed my nerves. Better safe then sorry right.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH as Apache user GaijinPunch Linux - Networking 6 11-27-2005 04:47 PM
Apache user permisions klemen Linux - Networking 3 02-17-2005 01:13 AM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 05:30 AM
Help with getting apache to work in User. BmxFace Linux - Software 4 11-14-2003 11:10 AM
Apache user hubergeek Linux - Networking 5 04-11-2002 11:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration