{"id":134,"date":"2021-12-15T16:27:00","date_gmt":"2021-12-15T08:27:00","guid":{"rendered":"https:\/\/43.143.33.33:8080\/?p=134"},"modified":"2023-01-16T11:07:50","modified_gmt":"2023-01-16T03:07:50","slug":"%e5%b7%a7%e9%81%87drwxr-xr-x-%e6%9d%83%e9%99%90","status":"publish","type":"post","link":"https:\/\/ext4.cn\/?p=134","title":{"rendered":"\u5de7\u9047&#8221;drwxr-xr-x.&#8221;\u6743\u9650"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>drwxr-xr-x. \u662fSELinux\u7684\u95ee\u9898 REDHAT6\u4e4b\u540e\u5b89\u5168\u63d0\u9ad8\u6240\u4ee5\u8bbe\u7f6e\u7684 \u5173\u95edSELINUX\u5c31\u597d\u4e86\n\n\u56e0\u4e3a\u65b0\u7248\u672cls\u628a\u591aacl\u548cselinux\u5c5e\u6027\u52a0\u8fdb\u53bb\u4e86\uff0c\u4e0e\u7cfb\u7edf\u65e0\u5173\uff0c\u65b0\u7248\u672c\u7684ls\u4ee3\u7801\u4f7f\u752812\u4e2a\u5b57\u8282\u957f\u7684char\u7c7b\u578b\u7684\u5b57\u7b26\u6570\u7ec4modebuf\u6765\u8bb0\u5f55\u6587\u4ef6\u5c5e\u751f\uff0c\u524d\u976210\u4e2a\u548c\u8001\u7248\u672c\u4e00\u6837\uff0c\u7b2c\u4e00\u8868\u793a\u7c7b\u578b\uff0c\u540e9\u4e2a\u8868\u793a\u6743\u9650\uff0c\u7b2c11\u4e2a\u8868\u793aselinux\u548cacl\u7684\u8bbe\u7f6e\uff0c\u6700\u540e\u4e00\u4e2a\u5f53\u7136\u662fc\u7684\u7ed3\u5c3e\u7b26\\0\u4e86\u3002\n\n\u5f53\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939\u53ea\u4f7f\u7528\u4e86selinux context\u7684\u5c5e\u6027\uff0c\u90a3\u4e48\u8fd9\u4e2a\u5728ls -l\u65f6\u540e\u9762\u4f1a\u662f\u4e00\u4e2a\u70b9\u3002\n\n\u53ea\u8981\u8bbe\u7f6e\u4e86acl\uff0c\u5c31\u662f\u90a3\u4e2asetacl\u8bbe\u7f6e\u7684\uff0c\u540e\u9762\u5c06\u662f\u4e00\u4e2a\u52a0(+)\u53f7\n-rwxr-xr--  root root    #\u6ca1\u6709selinux\u4e0a\u4e0b\u6587\uff0c\u6ca1\u6709ACL\n-rwx--xr-x+ root root    #\u53ea\u6709ACL\uff0c\u6ca1\u6709selinux\u4e0a\u4e0b\u6587\n-rw-r--r--. root root    #\u53ea\u6709selinux\u4e0a\u4e0b\u6587\uff0c\u6ca1\u6709ACL\n-rwxrwxr--+ root root    #\u6709selinux\u4e0a\u4e0b\u6587\uff0c\u6709ACL<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>1. \u6743\u9650\u4fee\u6539\n\n\u65b9\u6cd51: adb\u5728\u7ebf\u4fee\u6539seLinux\n\n$ getenforce;     \/\/\u83b7\u53d6\u5f53\u524dseLinux\u72b6\u6001\uff0cEnforcing(\u8868\u793a\u5df2\u6253\u5f00)\uff0cPermissive\uff08\u8868\u793a\u5df2\u5173\u95ed\uff09\n$ \/usr\/sbin\/sestatus -v\n\/\/SELinux status:                 enabled\nSELinuxfs mount:                \/sys\/fs\/selinux\nSELinux root directory:         \/etc\/selinux\n\/\/enabled\u4e3a\u5f00\u542f\n$ setenforce 1;   \/\/\u6253\u5f00seLinux\n$ setenforce 0;   \/\/\u5173\u95edseLinux\n\n\u65b9\u6cd52: \u5f7b\u5e95\u5173\u95ed\n\n1\u3001\u4e34\u65f6\u5173\u95ed\uff1a\u8f93\u5165\u547d\u4ee4setenforce 0\uff0c\u91cd\u542f\u7cfb\u7edf\u540e\u8fd8\u4f1a\u5f00\u542f\u3002\n2\u3001\u6c38\u4e45\u5173\u95ed\uff1a\u8f93\u5165\u547d\u4ee4vi \/etc\/selinux\/config\uff0c\u5c06SELINUX=enforcing\u6539\u4e3aSELINUX=disabled\uff0c\u7136\u540e\u4fdd\u5b58\u9000\u51fa\u3002<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[33],"_links":{"self":[{"href":"https:\/\/ext4.cn\/index.php?rest_route=\/wp\/v2\/posts\/134"}],"collection":[{"href":"https:\/\/ext4.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ext4.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ext4.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ext4.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134"}],"version-history":[{"count":0,"href":"https:\/\/ext4.cn\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions"}],"wp:attachment":[{"href":"https:\/\/ext4.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ext4.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ext4.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}