\u4e94\u3001SELinux\u65e5\u5fd7\u6587\u4ef6\u8bb0\u5f55\u6240\u9700\u7684\u670d\u52a1<\/strong><\/div>\n\u4f7f\u7528setsebool\u3001chcon\u3001restorecon\u7b49\u90fd\u662f\u4e3a\u4e86\u5f53\u67d0\u4e9b\u7f51\u7edc\u670d\u52a1\u65e0\u6cd5\u6b63\u5e38\u63d0\u4f9b\u76f8\u5173\u529f\u80fd\u65f6\u624d\u9700\u8981\u8fdb\u884c\u4fee\u6539\u7684\u4e00\u4e9b\u547d\u4ee4\u52a8\u4f5c\u3002CentOS\u63d0\u4f9b\u4e86\u51e0\u4e2a\u68c0\u6d4b\u7684\u670d\u52a1\u6765\u68c0\u6d4b\u5904\u7406\u5728\u767b\u5f55SELinux\u65f6\u4ea7\u751f\u7684\u9519\u8bef\uff0c\u90a3\u5c31\u662fauditd\u3001setroubleshoot\u3002<\/p>\n
1\u3001setroubleshoot\uff1a\u5c06\u9519\u8bef\u4fe1\u606f\u5199\u5165\/var\/log\/message\u4e0e\/var\/log\/setroubleshoot\/*<\/p>\n
\u5b89\u88c5\u5e76\u542f\u52a8\u8be5\u670d\u52a1<\/p>\n
yum install setroubleshoot setroubleshoot-server\r\nservice auditd restart<\/pre>\n\u8fd0\u4f5c\u65b9\u5f0f\uff1a
\n1\u3001\u5148\u7531auditd\u53bb\u547c\u53ebaudispd\u670d\u52a1
\n2\u3001\u7136\u540eaudispd\u670d\u52a1\u53bb\u542f\u52a8sedispatch\u7a0b\u5e8f
\n3\u3001sedispatch\u518d\u5c06\u539f\u672c\u7684auditd\u4fe1\u606f\u8f6c\u6210setroubleshoot\u7684\u4fe1\u606f\uff0c\u8fdb\u4e00\u6b65\u50a8\u5b58\u4e0b\u6765\u3002
\n\u4ee5httpd\u7a0b\u5e8f\u4ea7\u751f\u7684\u9519\u8bef\u4e3a\u4f8b
\n2\u3001\u4f7f\u7528E-mail\u6216\u5728\u547d\u4ee4\u5217\u4e0a\u9762\u76f4\u63a5\u63d0\u4f9bsetroubleshoot\u9519\u8bef\u4fe1\u606f
\n3\u3001SELinux\u9519\u8bef\u514b\u670d\u7684\u603b\u7ed3
\n\u7f51\u7edc\u8fde\u63a5\u8981\u901a\u8fc7SELinux\u7684\u6743\u9650\u5224\u5b9a\u540e\u624d\u80fd\u591f\u7ee7\u7eedrwx\u7684\u6743\u9650\u5bf9\u6bd4\uff0c\u800cSELinux\u7684\u5bf9\u6bd4\u9700\u8981\u901a\u8fc7\u7b56\u7565\u7684\u5404\u9879\u89c4\u5219\u5bf9\u6bd4\u540e\u624d\u80fd\u591f\u8fdb\u884cSELinux Type\u5b89\u5168\u6027\u73af\u5883\u7684\u5bf9\u6bd4\u3002\u800c\u540e\u7eed\u7684SELinux\u7684\u4fee\u6539\u901a\u8fc7chcon\u3001restorecon\u3001setsebool\u7b49\u547d\u4ee4\u6765\u5904\u7406\u3002\u901a\u8fc7\u5206\u6790\/var\/log\/messsage\u5185\u63d0\u4f9b\u7684setroubleshoot\u7684\u4fe1\u606f\u3002
\na\u3011\u5728\u670d\u52a1\u548crwx\u6743\u9650\u90fd\u6ca1\u6709\u95ee\u9898\uff0c\u5374\u65e0\u6cd5\u6210\u529f\u7684\u4f7f\u7528\u7f51\u7edc\u670d\u52a1\u65f6\uff0c\u5148\u4f7f\u7528setenforce 0 \u8bbe\u7f6e\u4e3a\u5bbd\u5bb9\u6a21\u5f0f
\nb\u3011\u518d\u6b21\u4f7f\u7528\u8be5\u7f51\u7edc\u670d\u52a1\uff0c\u5982\u679c\u8fd9\u6837\u5c31\u80fd\u4f7f\u7528\uff0c\u5219\u95ee\u9898\u51fa\u73b0\u5728SELinux\u4e0a\u9762\uff0c\u82e5\u4ecd\u65e0\u6cd5\u4f7f\u7528\u5219\u5e94\u4ece\u5176\u4ed6\u65b9\u9762\u8003\u8651\u6392\u9519\u3002
\nc\u3011\u5206\u6790\/var\/log\/message\u4e2d\u7684\u4fe1\u606f\uff0c\u627e\u5230sealert -l\u76f8\u5173\u7684\u4fe1\u606f\u5e76\u4e14\u6267\u884c
\nd\u3011\u627e\u5230Allow Access\u7684\u5173\u952e\u8bcd\uff0c\u6309\u7167\u91cc\u9762\u7684\u52a8\u4f5c\u6765\u8fdb\u884cSELinux\u7684\u9519\u8bef\u514b\u670d\u3002
\ne\u3011\u5904\u7406\u5b8c\u6bd5\u91cd\u65b0setenforce 1\uff0c\u518d\u6b21\u6d4b\u8bd5\u7f51\u7edc\u670d\u52a1<\/p>\n","protected":false},"excerpt":{"rendered":"
1\u3001\u4e3b\u4f53\uff08Subject\uff09 SELinux\u4e3b\u8981\u7ba1\u7406\u7684\u5c31\u662f\u7a0b\u5e8f\u3002\u53ef\u4ee5\u76f8\u6bd4\u4e8eprocess\u3002 2\u3001\u76ee\u6807\uff08Objec […]<\/p>\n","protected":false},"author":310,"featured_media":244275,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-244256","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=244256"}],"version-history":[{"count":10,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244256\/revisions"}],"predecessor-version":[{"id":244425,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244256\/revisions\/244425"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/244275"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=244256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=244256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=244256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}