{"id":101052,"date":"2026-09-06T01:56:57","date_gmt":"2026-09-05T17:56:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/101052.html"},"modified":"2026-09-06T01:56:57","modified_gmt":"2026-09-05T17:56:57","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%88%9d%e5%a7%8b%e5%8c%96-selinux-%e4%b8%89%e7%a7%8d%e8%bf%90%e8%a1%8c%e6%a8%a1%e5%bc%8f%e8%af%a6%e8%a7%a3%ef%bc%9aenforcing%e3%80%81permissive-%e5%92%8c-disabled","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/101052.html","title":{"rendered":"\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5"},"content":{"rendered":"<\/p>\n<p>\u5728\u670d\u52a1\u5668\u521d\u59cb\u5316\u7684\u8fc7\u7a0b\u4e2d&#xff0c;SELinux \u7684\u914d\u7f6e\u662f\u4e00\u4e2a\u4e0d\u53ef\u5ffd\u89c6\u7684\u5173\u952e\u73af\u8282\u3002\u5f88\u591a\u8fd0\u7ef4\u65b0\u624b\u9047\u5230\u670d\u52a1\u65e0\u6cd5\u542f\u52a8\u6216\u6587\u4ef6\u65e0\u6cd5\u8bbf\u95ee\u65f6&#xff0c;\u7b2c\u4e00\u53cd\u5e94\u5c31\u662f setenforce 0 \u751a\u81f3\u76f4\u63a5 disabled&#xff0c;\u8fd9\u5176\u5b9e\u662f\u975e\u5e38\u5371\u9669\u7684\u505a\u6cd5\u3002<\/p>\n<p>\u672c\u6587\u5c06\u7ed3\u5408\u670d\u52a1\u5668\u521d\u59cb\u5316\u7684\u5b9e\u9645\u573a\u666f&#xff0c;\u8be6\u89e3 SELinux \u7684\u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f&#xff0c;\u5e76\u7ed9\u51fa\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae\u3002<\/p>\n<p>\u4e00\u3001\u4ec0\u4e48\u662f SELinux&#xff1f;<\/p>\n<p>SELinux&#xff08;Security-Enhanced Linux&#xff0c;\u5b89\u5168\u589e\u5f3a\u578b Linux&#xff09;\u662f\u7f8e\u56fd\u56fd\u5bb6\u5b89\u5168\u5c40&#xff08;NSA&#xff09;\u5f00\u53d1\u7684\u4e00\u5957 Linux \u5185\u6838\u5b89\u5168\u5b50\u7cfb\u7edf\u3002\u5b83\u5b9e\u73b0\u4e86\u5f3a\u5236\u8bbf\u95ee\u63a7\u5236&#xff08;MAC, Mandatory Access Control&#xff09;&#xff0c;\u4e0e\u4f20\u7edf\u7684 Linux \u81ea\u4e3b\u8bbf\u95ee\u63a7\u5236&#xff08;DAC&#xff09;\u4e0d\u540c&#xff0c;SELinux \u4e3a\u7cfb\u7edf\u4e2d\u7684\u6bcf\u4e2a\u8fdb\u7a0b\u3001\u6587\u4ef6\u3001\u7aef\u53e3\u3001\u7528\u6237\u90fd\u6253\u4e0a\u5b89\u5168\u6807\u7b7e&#xff0c;\u5e76\u4f9d\u636e\u4e25\u683c\u7684\u5b89\u5168\u7b56\u7565\u6765\u63a7\u5236\u5b83\u4eec\u4e4b\u95f4\u7684\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<p>\u7b80\u5355\u6765\u8bf4&#xff1a;\u5373\u4f7f\u8fdb\u7a0b\u4ee5 root \u6743\u9650\u8fd0\u884c&#xff0c;SELinux \u4e5f\u80fd\u9650\u5236\u5b83\u7684\u884c\u4e3a\u3002<\/p>\n<p>\u4e8c\u3001\u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3<\/p>\n<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" style=\"width:100%\">\n<tr>\u6a21\u5f0f\u4e2d\u6587\u540d\u79f0\u7b56\u7565\u662f\u5426\u751f\u6548\u662f\u5426\u62e6\u622a\u8fdd\u89c4\u64cd\u4f5c\u662f\u5426\u8bb0\u5f55\u65e5\u5fd7<\/tr>\n<tbody>\n<tr>\n<td>Enforcing<\/td>\n<td>\u5f3a\u5236\u6a21\u5f0f<\/td>\n<td>\u751f\u6548<\/td>\n<td>\u62e6\u622a<\/td>\n<td>\u8bb0\u5f55<\/td>\n<\/tr>\n<tr>\n<td>Permissive<\/td>\n<td>\u5bbd\u677e\u6a21\u5f0f<\/td>\n<td>\u751f\u6548<\/td>\n<td>\u4e0d\u62e6\u622a<\/td>\n<td>\u8bb0\u5f55<\/td>\n<\/tr>\n<tr>\n<td>Disabled<\/td>\n<td>\u7981\u7528\u6a21\u5f0f<\/td>\n<td>\u4e0d\u751f\u6548<\/td>\n<td>\u4e0d\u62e6\u622a<\/td>\n<td>\u4e0d\u8bb0\u5f55<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>1. Enforcing&#xff08;\u5f3a\u5236\u6a21\u5f0f&#xff09;\u2014\u2014 \u751f\u4ea7\u73af\u5883\u6807\u51c6<\/p>\n<ul>\n<li>\u542b\u4e49&#xff1a;SELinux \u7b56\u7565\u5168\u6743\u751f\u6548&#xff0c;\u6240\u6709\u8fdd\u53cd\u7b56\u7565\u7684\u8bbf\u95ee\u8bf7\u6c42\u90fd\u4f1a\u88ab\u7cfb\u7edf\u62e6\u622a&#xff0c;\u5e76\u4ea7\u751f\u5ba1\u8ba1\u65e5\u5fd7\u3002<\/li>\n<li>\u7279\u70b9&#xff1a;\n<ul>\n<li>\u5b89\u5168\u9632\u62a4\u80fd\u529b\u6700\u5f3a<\/li>\n<li>\u7b56\u7565\u914d\u7f6e\u4e0d\u5f53\u53ef\u80fd\u5bfc\u81f4\u670d\u52a1\u65e0\u6cd5\u542f\u52a8<\/li>\n<li>\u7ba1\u7406\u5458\u9700\u6839\u636e\u65e5\u5fd7\u6392\u67e5\u95ee\u9898<\/li>\n<\/ul>\n<\/li>\n<li>\u67e5\u770b\u72b6\u6001&#xff1a;<\/li>\n<\/ul>\n<p>getenforce<\/p>\n<p>\u8f93\u51fa&#xff1a;Enforcing<\/p>\n<ul>\n<li>\u9002\u7528\u573a\u666f&#xff1a;\u751f\u4ea7\u670d\u52a1\u5668\u3001\u9700\u8981\u4e25\u683c\u5b89\u5168\u5408\u89c4\u7684\u73af\u5883<\/li>\n<\/ul>\n<p>2. Permissive&#xff08;\u5bbd\u677e\u6a21\u5f0f&#xff09;\u2014\u2014 &#x1f527; \u8c03\u8bd5\u4e13\u7528<\/p>\n<p>\u542b\u4e49&#xff1a;SELinux \u7b56\u7565\u5168\u6743\u751f\u6548&#xff0c;\u4f46\u8fdd\u53cd\u7b56\u7565\u7684\u8bbf\u95ee\u8bf7\u6c42\u4e0d\u4f1a\u88ab\u62e6\u622a&#xff0c;\u4ec5\u4ea7\u751f\u5ba1\u8ba1\u65e5\u5fd7\u3002\u76f8\u5f53\u4e8e\u201c\u53ea\u76d1\u63a7&#xff0c;\u4e0d\u6267\u6cd5\u201d\u3002<\/p>\n<p>\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u7cfb\u7edf\u529f\u80fd\u4e0d\u53d7\u5f71\u54cd<\/li>\n<li>\u6240\u6709\u8fdd\u89c4\u884c\u4e3a\u90fd\u88ab\u8bb0\u5f55\u5230\u65e5\u5fd7\u4e2d<\/li>\n<li>\u662f\u6545\u969c\u6392\u9664\u548c\u7b56\u7565\u8c03\u8bd5\u7684\u5229\u5668<\/li>\n<\/ul>\n<p>\u67e5\u770b\u72b6\u6001&#xff1a;<\/p>\n<p>getenforce<\/p>\n<p>\u8f93\u51fa&#xff1a;Permissive<\/p>\n<ul>\n<li>\u9002\u7528\u573a\u666f&#xff1a;\u7cfb\u7edf\u8c03\u8bd5\u3001\u7b56\u7565\u6d4b\u8bd5\u3001\u4ece Disabled \u5207\u6362\u5230 Enforcing \u524d\u7684\u201c\u8fc7\u6e21\u671f\u201d<\/li>\n<\/ul>\n<p>3. Disabled&#xff08;\u7981\u7528\u6a21\u5f0f&#xff09;\u2014\u2014 \u26a0\ufe0f \u4e0d\u63a8\u8350<\/p>\n<ul>\n<li>\u542b\u4e49&#xff1a;SELinux \u529f\u80fd\u5b8c\u5168\u5173\u95ed&#xff0c;\u5185\u6838\u4e0d\u52a0\u8f7d\u5b89\u5168\u7b56\u7565&#xff0c;\u4e5f\u4e0d\u8bb0\u5f55\u4efb\u4f55 SELinux \u76f8\u5173\u4e8b\u4ef6\u3002<\/li>\n<li>\u7279\u70b9&#xff1a;\n<ul>\n<li>SELinux \u5b8c\u5168\u4e0d\u8d77\u4f5c\u7528<\/li>\n<li>\u7cfb\u7edf\u9000\u5316\u4e3a\u4f20\u7edf DAC \u6743\u9650\u63a7\u5236<\/li>\n<li>\u5207\u6362\u5230\u5176\u4ed6\u6a21\u5f0f\u9700\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5e76\u91cd\u542f<\/li>\n<\/ul>\n<\/li>\n<li>\u67e5\u770b\u72b6\u6001&#xff1a;<\/li>\n<\/ul>\n<p>getenforce<br \/>\n# \u8f93\u51fa&#xff1a;Disabled<\/p>\n<ul>\n<li>\u9002\u7528\u573a\u666f&#xff1a;\u4e0e SELinux \u4e0d\u517c\u5bb9\u7684\u65e7\u7248\u5e94\u7528\u3001\u4e34\u65f6\u6545\u969c\u6392\u67e5&#xff08;\u4e0d\u5efa\u8bae\u957f\u671f\u4f7f\u7528&#xff09;<\/li>\n<\/ul>\n<p>\u4e09\u3001\u67e5\u770b\u548c\u5207\u6362\u6a21\u5f0f<\/p>\n<h5>\u67e5\u770b\u5f53\u524d\u6a21\u5f0f<\/h5>\n<p># \u7b80\u5355\u67e5\u770b<br \/>\ngetenforce<br \/>\n\u8be6\u7ec6\u67e5\u770b&#xff08;\u542b\u7b56\u7565\u7c7b\u578b&#xff09;<br \/>\nsestatus<\/p>\n<h5>\u5207\u6362\u6a21\u5f0f<\/h5>\n<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" style=\"width:100%\">\n<tr>\u64cd\u4f5c\u547d\u4ee4\u751f\u6548\u65b9\u5f0f<\/tr>\n<tbody>\n<tr>\n<td>\u4e34\u65f6\u5207\u6362\u5230 Enforcing<\/td>\n<td>sudo setenforce 1<\/td>\n<td>\u7acb\u5373\u751f\u6548&#xff0c;\u91cd\u542f\u5931\u6548<\/td>\n<\/tr>\n<tr>\n<td>\u4e34\u65f6\u5207\u6362\u5230 Permissive<\/td>\n<td>sudo setenforce 0<\/td>\n<td>\u7acb\u5373\u751f\u6548&#xff0c;\u91cd\u542f\u5931\u6548<\/td>\n<\/tr>\n<tr>\n<td>\u6c38\u4e45\u4fee\u6539<\/td>\n<td>\u7f16\u8f91 \/etc\/selinux\/config<\/td>\n<td>\u91cd\u542f\u540e\u751f\u6548<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p># \u6c38\u4e45\u914d\u7f6e\u793a\u4f8b<br \/>\nsudo vi \/etc\/selinux\/config<br \/>\nSELINUX&#061;enforcing   # \u53ef\u9009&#xff1a;enforcing \/ permissive \/ disabled<br \/>\nsudo reboot<\/p>\n<p>\u26a0\ufe0f \u91cd\u8981&#xff1a;setenforce \u547d\u4ee4\u65e0\u6cd5\u5c06\u7cfb\u7edf\u4ece Disabled \u5207\u6362\u5230\u5176\u4ed6\u6a21\u5f0f&#xff0c;\u5fc5\u987b\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5e76\u91cd\u542f\u3002<\/p>\n<p>\u56db\u3001\u670d\u52a1\u5668\u521d\u59cb\u5316\u4e2d\u7684\u6700\u4f73\u5b9e\u8df5<\/p>\n<h5>1. \u751f\u4ea7\u670d\u52a1\u5668\u5fc5\u987b\u4fdd\u6301 Enforcing<\/h5>\n<p>\u8fd9\u662f SELinux \u7684\u8bbe\u8ba1\u521d\u8877&#xff0c;\u80fd\u4e3a\u670d\u52a1\u5668\u63d0\u4f9b\u6700\u9ad8\u7ea7\u522b\u7684\u5b89\u5168\u9632\u62a4\u3002\u4e0d\u8981\u56e0\u4e3a\u56fe\u7701\u4e8b\u5c31\u5173\u95ed\u5b83\u3002<\/p>\n<h5>2. \u4ece Disabled \u5207\u6362\u5230 Enforcing \u7684\u201c\u56db\u6b65\u8d70\u201d\u7b56\u7565<\/h5>\n<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" style=\"width:100%\">\n<tr>\u6b65\u9aa4\u64cd\u4f5c\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u7b2c\u4e00\u6b65<\/td>\n<td>SELINUX&#061;permissive&#xff0c;\u91cd\u542f<\/td>\n<td>\u5148\u8fdb\u5165\u5bbd\u5bb9\u6a21\u5f0f&#xff0c;\u786e\u4fdd\u4e1a\u52a1\u4e0d\u53d7\u5f71\u54cd<\/td>\n<\/tr>\n<tr>\n<td>\u7b2c\u4e8c\u6b65<\/td>\n<td>\u8fd0\u884c\u4e1a\u52a1&#xff0c;\u67e5\u770b\u65e5\u5fd7<\/td>\n<td>ausearch -m avc -ts today \u67e5\u770b\u6240\u6709\u8fdd\u89c4\u4e8b\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>\u7b2c\u4e09\u6b65<\/td>\n<td>\u9010\u4e2a\u4fee\u590d\u8fdd\u89c4\u9879<\/td>\n<td>\u4f7f\u7528 audit2allow \u751f\u6210\u7b56\u7565\u6a21\u5757&#xff0c;\u6216\u8c03\u6574\u5e03\u5c14\u503c\/\u4e0a\u4e0b\u6587<\/td>\n<\/tr>\n<tr>\n<td>\u7b2c\u56db\u6b65<\/td>\n<td>SELINUX&#061;enforcing&#xff0c;\u91cd\u542f<\/td>\n<td>\u786e\u8ba4\u65e0\u8fdd\u89c4\u540e&#xff0c;\u6b63\u5f0f\u542f\u7528\u5f3a\u5236\u6a21\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>3. \u9047\u5230\u6743\u9650\u95ee\u9898\u65f6&#xff0c;\u4e0d\u8981\u7acb\u5373\u5173\u95ed SELinux<\/h5>\n<p>\u6392\u67e5\u4f18\u5148\u7ea7&#xff08;\u7531\u7b80\u5230\u7e41&#xff09;&#xff1a;<\/p>\n<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" style=\"width:100%\">\n<tr>\u4f18\u5148\u7ea7\u65b9\u6cd5\u547d\u4ee4\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>1\ufe0f\u20e3<\/td>\n<td>\u67e5\u770b\u65e5\u5fd7\u786e\u8ba4\u95ee\u9898<\/td>\n<td>ausearch -m avc -ts recent<\/td>\n<\/tr>\n<tr>\n<td>2\ufe0f\u20e3<\/td>\n<td>\u8c03\u6574\u5e03\u5c14\u503c\u5f00\u5173<\/td>\n<td>setsebool -P httpd_can_network_connect on<\/td>\n<\/tr>\n<tr>\n<td>3\ufe0f\u20e3<\/td>\n<td>\u6062\u590d\u6587\u4ef6\u4e0a\u4e0b\u6587<\/td>\n<td>restorecon -Rv \/var\/www\/html<\/td>\n<\/tr>\n<tr>\n<td>4\ufe0f\u20e3<\/td>\n<td>\u4fee\u6539\u6587\u4ef6\u4e0a\u4e0b\u6587<\/td>\n<td>semanage fcontext -a -t httpd_sys_content_t &#034;\/web(\/.*)?&#034;<\/td>\n<\/tr>\n<tr>\n<td>5\ufe0f\u20e3<\/td>\n<td>\u751f\u6210\u81ea\u5b9a\u4e49\u7b56\u7565\u6a21\u5757<\/td>\n<td>ausearch -m avc | audit2allow -M mypolicy<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e94\u3001\u5e38\u7528\u547d\u4ee4\u901f\u67e5\u8868<\/p>\n<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" style=\"width:100%\">\n<tr>\u547d\u4ee4\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>getenforce<\/td>\n<td>\u67e5\u770b\u5f53\u524d SELinux \u6a21\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>sestatus<\/td>\n<td>\u67e5\u770b SELinux \u8be6\u7ec6\u72b6\u6001<\/td>\n<\/tr>\n<tr>\n<td>setenforce 1\/0<\/td>\n<td>\u4e34\u65f6\u5207\u6362 Enforcing \/ Permissive<\/td>\n<\/tr>\n<tr>\n<td>ls -Z<\/td>\n<td>\u67e5\u770b\u6587\u4ef6\u7684 SELinux \u4e0a\u4e0b\u6587<\/td>\n<\/tr>\n<tr>\n<td>ps -Z<\/td>\n<td>\u67e5\u770b\u8fdb\u7a0b\u7684 SELinux \u4e0a\u4e0b\u6587<\/td>\n<\/tr>\n<tr>\n<td>ausearch -m avc -ts recent<\/td>\n<td>\u67e5\u770b\u6700\u8fd1\u88ab SELinux \u62d2\u7edd\u7684\u4e8b\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>audit2allow -a<\/td>\n<td>\u5c06\u5ba1\u8ba1\u65e5\u5fd7\u8f6c\u6362\u4e3a SELinux \u7b56\u7565\u6a21\u5757<\/td>\n<\/tr>\n<tr>\n<td>setsebool -P \u5e03\u5c14\u540d on\/off<\/td>\n<td>\u6c38\u4e45\u5f00\u542f\/\u5173\u95ed SELinux \u5e03\u5c14\u503c<\/td>\n<\/tr>\n<tr>\n<td>restorecon -Rv \u76ee\u5f55<\/td>\n<td>\u9012\u5f52\u6062\u590d\u6587\u4ef6\u9ed8\u8ba4\u4e0a\u4e0b\u6587<\/td>\n<\/tr>\n<tr>\n<td>semanage fcontext -a -t \u7c7b\u578b \u8def\u5f84<\/td>\n<td>\u6c38\u4e45\u4fee\u6539\u6587\u4ef6\u4e0a\u4e0b\u6587\u89c4\u5219<\/td>\n<\/tr>\n<tr>\n<td>semanage port -a -t \u7c7b\u578b -p tcp \u7aef\u53e3<\/td>\n<td>\u6c38\u4e45\u4fee\u6539\u7aef\u53e3\u4e0a\u4e0b\u6587\u89c4\u5219<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u516d\u3001\u603b\u7ed3<\/p>\n<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" style=\"width:100%\">\n<tr>\u6a21\u5f0f\u5b89\u5168\u6027\u53ef\u7528\u6027\u63a8\u8350\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td>Enforcing<\/td>\n<td>&#x1f512; \u6700\u9ad8<\/td>\n<td>\u9700\u6b63\u786e\u914d\u7f6e<\/td>\n<td>\u751f\u4ea7\u73af\u5883 \u2705<\/td>\n<\/tr>\n<tr>\n<td>Permissive<\/td>\n<td>\u26a0\ufe0f \u76d1\u63a7\u7ea7<\/td>\n<td>\u4e0d\u5f71\u54cd\u4e1a\u52a1<\/td>\n<td>\u8c03\u8bd5\u3001\u6d4b\u8bd5<\/td>\n<\/tr>\n<tr>\n<td>Disabled<\/td>\n<td>\u274c \u65e0<\/td>\n<td>\u65e0\u9650\u5236<\/td>\n<td>\u4e0d\u63a8\u8350\u957f\u671f\u4f7f\u7528 \u274c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e00\u53e5\u8bdd\u603b\u7ed3&#xff1a;<\/p>\n<p>\u751f\u4ea7\u73af\u5883\u575a\u6301\u7528 Enforcing&#xff0c;\u8c03\u8bd5\u65f6\u5207 Permissive&#xff0c;\u6c38\u8fdc\u4e0d\u8981\u8f7b\u6613 Disabled\u3002<\/p>\n<p>\u5728\u670d\u52a1\u5668\u521d\u59cb\u5316\u9636\u6bb5\u5c31\u6b63\u786e\u914d\u7f6e SELinux\u3002<\/p>\n<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" style=\"width:100%\">\n<tr>\u5e8f\u53f7\u68c0\u67e5\u9879\u72b6\u6001<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>\u67e5\u770b\u5f53\u524d\u6a21\u5f0f getenforce<\/td>\n<td>\u2610<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\u786e\u8ba4\u4e3a Enforcing \u6216\u89c4\u5212\u597d\u5207\u6362\u8def\u5f84<\/td>\n<td>\u2610<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>\u68c0\u67e5\u5173\u952e\u670d\u52a1\u65e5\u5fd7\u662f\u5426\u6709 AVC \u62d2\u7edd<\/td>\n<td>\u2610<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>\u786e\u8ba4 restorecon \u5df2\u6062\u590d\u5173\u952e\u76ee\u5f55\u4e0a\u4e0b\u6587<\/td>\n<td>\u2610<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>\u786e\u8ba4 setsebool \u5df2\u914d\u7f6e\u5fc5\u8981\u7684\u5e03\u5c14\u503c<\/td>\n<td>\u2610<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>\u52a0\u5165\u76d1\u63a7&#xff08;auditd\u3001\u65e5\u5fd7\u544a\u8b66&#xff09;<\/td>\n<td>\u2610<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u670d\u52a1\u5668\u521d\u59cb\u5316\u7684\u8fc7\u7a0b\u4e2d&#xff0c;SELinux \u7684\u914d\u7f6e\u662f\u4e00\u4e2a\u4e0d\u53ef\u5ffd\u89c6\u7684\u5173\u952e\u73af\u8282\u3002\u5f88\u591a\u8fd0\u7ef4\u65b0\u624b\u9047\u5230\u670d\u52a1\u65e0\u6cd5\u542f\u52a8\u6216\u6587\u4ef6\u65e0\u6cd5\u8bbf\u95ee\u65f6&#xff0c;\u7b2c\u4e00\u53cd\u5e94\u5c31\u662f setenforce 0 \u751a\u81f3\u76f4\u63a5 disabled&#xff0c;\u8fd9\u5176\u5b9e\u662f\u975e\u5e38\u5371\u9669\u7684\u505a\u6cd5\u3002\u672c\u6587\u5c06\u7ed3\u5408\u670d\u52a1\u5668\u521d\u59cb\u5316\u7684\u5b9e\u9645\u573a\u666f&#xff0c;\u8be6\u89e3 SELinux \u7684\u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f&#xff0c;\u5e76\u7ed9\u51fa\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae\u3002\u4e00\u3001\u4ec0\u4e48\u662f SELinux&#xff1f;SELinux&#xff08;Security-Enhanced <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[92],"topic":[],"class_list":["post-101052","post","type-post","status-publish","format-standard","hentry","category-server","tag-github"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/101052.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u670d\u52a1\u5668\u521d\u59cb\u5316\u7684\u8fc7\u7a0b\u4e2d&#xff0c;SELinux \u7684\u914d\u7f6e\u662f\u4e00\u4e2a\u4e0d\u53ef\u5ffd\u89c6\u7684\u5173\u952e\u73af\u8282\u3002\u5f88\u591a\u8fd0\u7ef4\u65b0\u624b\u9047\u5230\u670d\u52a1\u65e0\u6cd5\u542f\u52a8\u6216\u6587\u4ef6\u65e0\u6cd5\u8bbf\u95ee\u65f6&#xff0c;\u7b2c\u4e00\u53cd\u5e94\u5c31\u662f setenforce 0 \u751a\u81f3\u76f4\u63a5 disabled&#xff0c;\u8fd9\u5176\u5b9e\u662f\u975e\u5e38\u5371\u9669\u7684\u505a\u6cd5\u3002\u672c\u6587\u5c06\u7ed3\u5408\u670d\u52a1\u5668\u521d\u59cb\u5316\u7684\u5b9e\u9645\u573a\u666f&#xff0c;\u8be6\u89e3 SELinux \u7684\u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f&#xff0c;\u5e76\u7ed9\u51fa\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae\u3002\u4e00\u3001\u4ec0\u4e48\u662f SELinux&#xff1f;SELinux&#xff08;Security-Enhanced\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/101052.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-05T17:56:57+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101052.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/101052.html\",\"name\":\"\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-05T17:56:57+00:00\",\"dateModified\":\"2026-09-05T17:56:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/101052.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/101052.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101052.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/101052.html","og_locale":"zh_CN","og_type":"article","og_title":"\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u670d\u52a1\u5668\u521d\u59cb\u5316\u7684\u8fc7\u7a0b\u4e2d&#xff0c;SELinux \u7684\u914d\u7f6e\u662f\u4e00\u4e2a\u4e0d\u53ef\u5ffd\u89c6\u7684\u5173\u952e\u73af\u8282\u3002\u5f88\u591a\u8fd0\u7ef4\u65b0\u624b\u9047\u5230\u670d\u52a1\u65e0\u6cd5\u542f\u52a8\u6216\u6587\u4ef6\u65e0\u6cd5\u8bbf\u95ee\u65f6&#xff0c;\u7b2c\u4e00\u53cd\u5e94\u5c31\u662f setenforce 0 \u751a\u81f3\u76f4\u63a5 disabled&#xff0c;\u8fd9\u5176\u5b9e\u662f\u975e\u5e38\u5371\u9669\u7684\u505a\u6cd5\u3002\u672c\u6587\u5c06\u7ed3\u5408\u670d\u52a1\u5668\u521d\u59cb\u5316\u7684\u5b9e\u9645\u573a\u666f&#xff0c;\u8be6\u89e3 SELinux \u7684\u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f&#xff0c;\u5e76\u7ed9\u51fa\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae\u3002\u4e00\u3001\u4ec0\u4e48\u662f SELinux&#xff1f;SELinux&#xff08;Security-Enhanced","og_url":"https:\/\/www.wsisp.com\/helps\/101052.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-05T17:56:57+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/101052.html","url":"https:\/\/www.wsisp.com\/helps\/101052.html","name":"\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-05T17:56:57+00:00","dateModified":"2026-09-05T17:56:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/101052.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/101052.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/101052.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u670d\u52a1\u5668\u521d\u59cb\u5316 SELinux \u4e09\u79cd\u8fd0\u884c\u6a21\u5f0f\u8be6\u89e3\uff1aEnforcing\u3001Permissive \u548c Disabled \u7684\u533a\u522b\u4e0e\u6700\u4f73\u5b9e\u8df5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/101052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=101052"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/101052\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=101052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=101052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=101052"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=101052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}