当我运行我的FTPtesting来testing完整的function时,我担心为什么我会在如mkdir这样的stream行命令上获得avc拒绝错误?
这是AVC拒绝消息:
type=AVC msg=audit(1365021919.400:283): avc: denied { create } for pid=2210 comm="mkdir" name="64F77DCE-9C9F-11E2-90A8-39AEF085A14A" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:user_home_t:s0 tclass=dir Was caused by: Missing type enforcement (TE) allow rule. You can use audit2allow to generate a loadable module to allow this access.
根据Fedora的网站,缺失types执行规则通常是由SELinux策略中的错误引起的。 那么,这是一个真正的错误?
看来你正试图让你的web服务器写入用户的主目录。 没有SELinux引用策略来允许这种行为。 您应该仔细考虑是否应该提供用户主目录中的内容。
如果您确实需要访问权限,则可以使用audit2allow实用程序来生成可以加载并允许访问的本地策略模块。
我很困惑的是FTP通过Apache或只是普通的旧FTP?
如果是普通的旧FTP,请检查SELinux上下文,试图创build一个新的目录。 它可能被设置不正确。
如果是通过Apache:
您可以通过以下命令启用Apache来使用主目录:
setsebool -P httpd_enable_homedirs chcon -R -t httpd_sys_content_t ~user/public_html
参考: http : //fedoraproject.org/wiki/SELinux/apache
已经将不同的安全上下文赋予要添加的端口时发生错误。 如果您使用的是Tomcat的基本HTTP端口8080,则该端口为http_cache_port_ttypes。 如果你正在使用nginx构build8081,并且它transproxy_port_t或两个上下文apache web服务器生成一个错误,因为它无法连接。 如果您需要更改安全上下文,并且不需要使用-m选项而不使用-a选项。
~# semanage port -l |grep 8081 transproxy_port_t tcp 8081
接着
~# semanage port -l |grep http_port_t http_port_t tcp 80, 443, 488, 8008, 8009, 8443
加
# semanage port -m -p tcp -t http_port_t 8081