LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-23-2005, 07:36 PM   #1
mazonka
LQ Newbie
 
Registered: Nov 2005
Posts: 3

Rep: Reputation: 0
httpd-selinux. Real pleasure. Who can explain this?


Read the following carefully. I am sure you will enjoy this, if this is not trivial for you (it was not for me).
I cannot give good explanation to the following.

[root@srv www]# pwd
/var/www
[root@srv www]# ls
cgi-bin error icons
[root@srv www]# /usr/sbin/httpd -t
Syntax error on line 266 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[root@srv www]# mkdir html
[root@srv www]# /usr/sbin/httpd -t
Syntax OK
[root@srv www]# /etc/init.d/httpd start
Starting httpd: [ OK ]
[root@srv www]# /etc/init.d/httpd stop
Stopping httpd: [ OK ]
[root@srv www]# ls -l
total 32
drwxr-xr-x 2 root root 4096 Sep 2 11:56 cgi-bin
drwxr-xr-x 3 root root 4096 Nov 23 11:24 error
drwxr-xr-x 2 root root 4096 Nov 24 11:37 html
drwxr-xr-x 3 root root 4096 Nov 23 11:24 icons
[root@srv www]# mv html html.ok
[root@srv www]# ls -l /home/john/html
total 0
[root@srv www]# mv /home/john/html ./
[root@srv www]# ls -l
total 40
drwxr-xr-x 2 root root 4096 Sep 2 11:56 cgi-bin
drwxr-xr-x 3 root root 4096 Nov 23 11:24 error
drwxr-xr-x 2 john pub 4096 Nov 24 11:35 html
drwxr-xr-x 2 root root 4096 Nov 24 11:37 html.ok
drwxr-xr-x 3 root root 4096 Nov 23 11:24 icons

[root@srv www]# /etc/init.d/httpd start
Starting httpd: [FAILED]
[root@srv www]# /etc/init.d/httpd stop
Stopping httpd: [FAILED]
[root@srv www]# chown root html; chgrp root html
[root@srv www]# ls -l
total 40
drwxr-xr-x 2 root root 4096 Sep 2 11:56 cgi-bin
drwxr-xr-x 3 root root 4096 Nov 23 11:24 error
drwxr-xr-x 2 root root 4096 Nov 24 11:35 html
drwxr-xr-x 2 root root 4096 Nov 24 11:37 html.ok
drwxr-xr-x 3 root root 4096 Nov 23 11:24 icons
[root@srv www]# /etc/init.d/httpd start
Starting httpd: [FAILED]
[root@srv www]# /etc/init.d/httpd stop
Stopping httpd: [FAILED]
[root@srv www]# mv html html.bad
[root@srv www]# mv html.ok html
[root@srv www]# /etc/init.d/httpd start
Starting httpd: [ OK ]
[root@srv www]# /etc/init.d/httpd stop
Stopping httpd: [ OK ]
[root@srv www]# ls -l
total 40
drwxr-xr-x 2 root root 4096 Sep 2 11:56 cgi-bin
drwxr-xr-x 3 root root 4096 Nov 23 11:24 error
drwxr-xr-x 2 root root 4096 Nov 24 11:37 html
drwxr-xr-x 2 root root 4096 Nov 24 11:35 html.bad
drwxr-xr-x 3 root root 4096 Nov 23 11:24 icons

[root@srv www]# ls -l html html.bad
html:
total 0

html.bad:
total 0
[root@srv www]# mv html html.ok
[root@srv www]# mv html.bad html
[root@srv www]# /etc/init.d/httpd start
Starting httpd: [FAILED]
[root@srv www]# /etc/init.d/httpd stop
Stopping httpd: [FAILED]
[root@srv www]# sh /etc/init.d/httpd start
Starting httpd: [ OK ]
[root@srv www]# /etc/init.d/httpd stop
Stopping httpd: [ OK ]
[root@srv www]#


Up to here it was a mistery. Now some light...


[root@srv www]# mv html html.bad
[root@srv www]# ls -l
total 40
drwxr-xr-x 2 root root 4096 Sep 2 11:56 cgi-bin
drwxr-xr-x 3 root root 4096 Nov 23 11:24 error
drwxr-xr-x 2 root root 4096 Nov 24 11:35 html.bad
drwxr-xr-x 2 root root 4096 Nov 24 11:37 html.ok
drwxr-xr-x 3 root root 4096 Nov 23 11:24 icons
[root@srv www]# ls -lZ
drwxr-xr-x root root system_u:object_r:httpd_sys_script_exec_t cgi-bin
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t error
drwxr-xr-x root root user_u:object_r:user_home_t html.bad
drwxr-xr-x root root root:object_r:httpd_sys_content_t html.ok
drwxr-xr-x root root system_u:object_r:httpd_sys_content_t icons
[root@srv www]#

Any comments?
 
Old 11-24-2005, 03:06 PM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
This document might help: http://fedora.redhat.com/docs/selinux-apache-fc3/
 
Old 11-24-2005, 03:26 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
What a picture-perfect example of how "hardened" Linux systems are different ... and of why.

Under normal conditions, an intruder could easily have prepared a new directory, and with two commands could have moved it into place, where it would have been accepted. But security contexts thwarted it. It's no longer simply a matter of where the stuff is, nor what it is named; now, there must be more.
 
  


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
Real Plyer...hehe ;) Giving me Real Problems.. Azzath Linux - Software 0 02-14-2005 08:56 AM
service httpd status, results in httpd dead but subsys locked squadja Red Hat 2 09-11-2004 10:31 PM
dual display question - real real newbie !! Jay_Dee007 Linux - Newbie 1 09-29-2003 08:33 AM
httpd chokes on ScriptAlias line in Apache httpd.conf lhoff Linux - Software 1 07-14-2003 10:32 PM
Real Programmers Real People Real CS Students nakkaya General 5 07-04-2003 02:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:38 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