selinux的问题,似乎没有起作用

撒旦的使者
selinux的问题,似乎没有起作用

首先查看selinux的状态:
[code][root@localhost ~]# sestatus
SELinux status:         enabled
SELinuxfs mount:        /selinux
Current mode:           enforcing
Mode from config file:  enforcing
Policy version:         18
Policy from config file:targeted

Policy booleans:
allow_syslog_to_console inactive
allow_ypbind            inactive
dhcpd_disable_trans     inactive
httpd_builtin_scripting active
httpd_disable_trans     active
httpd_enable_cgi        active
httpd_enable_homedirs   active
httpd_ssi_exec          active
httpd_tty_comm          inactive
httpd_unified           active
mysqld_disable_trans    inactive
named_disable_trans     inactive
named_write_master_zonesinactive
nscd_disable_trans      inactive
ntpd_disable_trans      inactive
pegasus_disable_trans   inactive
portmap_disable_trans   inactive
postgresql_disable_transinactive
snmpd_disable_trans     inactive
squid_disable_trans     inactive
syslogd_disable_trans   inactive
use_nfs_home_dirs       inactive
use_samba_home_dirs     inactive
use_syslogng            inactive
winbind_disable_trans   inactive
ypbind_disable_trans    inactive
[/code]
执行重启http服务
[code][root@localhost ~]# service httpd restart
停止 httpd:                                               [  确定  ]
启动 httpd:                                               [  确定  ]
[/code]

为何没有任何限制?

[[i] 本帖最后由 撒旦的使者 于 2008-6-21 00:09 编辑 [/i]]

撒旦的使者
注意看了一下
SELinuxfs mount:        /selinux

是不是和这个有关 应该mount整个根?
试试先?

李某人
对selinux研究的不多,帮你顶顶吧

kenduest
問 1 樓,請問啟動 apache 服務正常,與 selinux 啟動部份有啥關係嗎?

--

撒旦的使者
回复 #4 kenduest 的帖子

我希望selinux可以保護http進程,但似乎缺些什么沒有生效。
不太明白SELinuxfs mount:        /selinux是什么意思。

cnjnhu
selinux 是增强安全的linux  和你自己在本地重新启动没关系
你从远程使用服务试试就知道了

cuci
selinux的安全性不是为了禁止服务是否能启动,而是能否允许与服务建立连接

kenduest
[quote]原帖由 [i]撒旦的使者[/i] 于 2008-6-20 16:53 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&pid=6621989&ptid=1012199][img]http://linux.chinaunix.net/bbs/images/common/back.gif[/img][/url]
我希望selinux可以保護http進程,但似乎缺些什么沒有生效。
不太明白SELinuxfs mount:        /selinux是什么意思。 [/quote]

那您可能嚴重誤解了 selinux 的功能.

建議你先閱讀:

[url]http://docs.fedoraproject.org/selinux-apache-fc3/[/url]

再者依據你的資訊:

[code]httpd_disable_trans     active[/code]

都設定 apache 不要用 selinux 保護了,那請問您實際需求是 ?

--

[[i] 本帖最后由 kenduest 于 2008-6-20 19:38 编辑 [/i]]

luo118
原來是這樣啊,差點,我也了解錯了。

lasama
selinux是保护你这些服务是否允许被访问到,而不是能不能启动的


如果你要给apache设置selinux的保护,需要加上更严格的权限
可以用 ls -Z查看一下

撒旦的使者
非常感謝您的回復,實際上下面這種情況也一樣:
[code][root@localhost ~]# sestatus
SELinux status:         enabled
SELinuxfs mount:        /selinux
Current mode:           enforcing
Mode from config file:  enforcing
Policy version:         18
Policy from config file:targeted

Policy booleans:
allow_syslog_to_console inactive
allow_ypbind            inactive
dhcpd_disable_trans     inactive
httpd_builtin_scripting active
httpd_disable_trans     active
httpd_enable_cgi        active
httpd_enable_homedirs   active
httpd_ssi_exec          active
httpd_tty_comm          inactive
httpd_unified           active
mysqld_disable_trans    inactive
named_disable_trans     inactive
named_write_master_zonesinactive
nscd_disable_trans      inactive
ntpd_disable_trans      inactive
pegasus_disable_trans   inactive
portmap_disable_trans   inactive
postgresql_disable_transinactive
snmpd_disable_trans     inactive
squid_disable_trans     inactive
syslogd_disable_trans   inactive
use_nfs_home_dirs       inactive
use_samba_home_dirs     inactive
use_syslogng            inactive
winbind_disable_trans   inactive
ypbind_disable_trans    inactive
[root@localhost ~]# service httpd restart
停止 httpd:                                               [  确定  ]
启动 httpd:                                               [  确定  ]
[root@localhost ~]#
[/code]
請看下面的截圖:
[attach]184760[/attach]

[[i] 本帖最后由 撒旦的使者 于 2008-6-21 00:35 编辑 [/i]]

撒旦的使者
回复 #6 cnjnhu 的帖子

我是ssh远程连上去的

kenduest
您可能還沒進入情況。

我建議你可以提供實際證明,證明 selinux 沒有保護到 apache,那這樣討論才比較有意義。另外啟動 apache 與 libpcre 載入不了,請問與你要問的 selinux 關係是啥 ?

selinux 於 apache 部份,是提供一個 httpd_t 這類 domain