{"id":4179,"date":"2019-07-24T00:01:06","date_gmt":"2019-07-23T16:01:06","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=4179"},"modified":"2019-07-26T23:45:34","modified_gmt":"2019-07-26T15:45:34","slug":"seinfo","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/seinfo","title":{"rendered":"seinfo\u547d\u4ee4 – \u67e5\u8be2SELinux\u7b56\u7565\u89c4\u5219"},"content":{"rendered":"\n

seinfo\u547d\u4ee4\u662f\u7528\u6765\u67e5\u8be2SELinux\u7684\u7b56\u7565\u63d0\u4f9b\u591a\u5c11\u76f8\u5173\u89c4\u5219\uff0c\u4e00\u4e2a\u4e3b\u4f53\u8fdb\u7a0b\u80fd\u5426\u8bfb\u53d6\u5230\u76ee\u6807\u6587\u4ef6\u8d44\u6e90\u7684\u91cd\u70b9\u662f\u5728\u4e8eSELinux\u7684\u7b56\u7565\u4ee5\u53ca\u7b56\u7565\u5185\u7684\u5404\u9879\u89c4\u5219\uff0c\u7136\u540e\u518d\u901a\u8fc7\u8be5\u89c4\u5219\u7684\u5b9a\u4e49\u53bb\u5904\u7406\u5404\u9879\u76ee\u6807\u6587\u4ef6\u7684\u5b89\u5168\u4e0a\u4e0b\u6587\uff0c\u5c24\u5176\u662f\u201c\u7c7b\u578b\u201d\u90e8\u5206\u3002SELinux\u7684\u7b56\u7565\u4e0e\u89c4\u5219\u7ba1\u7406\u76f8\u5173\u547d\u4ee4\uff1aseinfo\u547d\u4ee4\u3001sesearch\u547d\u4ee4\u3001getsebool\u547d\u4ee4\u3001setsebool\u547d\u4ee4\u3001semanage\u547d\u4ee4\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>seinfo [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-a<\/td>\u5217\u51faSELinux\u7684\u72b6\u6001\u3001\u89c4\u5219\u5e03\u5c14\u503c\u3001\u8eab\u4efd\u8bc6\u522b\u3001\u89d2\u8272\u3001\u7c7b\u578b\u7b49\u6240\u6709\u4fe1\u606f<\/td><\/tr>
-t<\/td>\u5217\u51faSELinux\u6240\u6709\u7c7b\u578b(type)\u7684\u79cd\u7c7b<\/td><\/tr>
-r<\/td>\u5217\u51faSELinux\u6240\u6709\u89d2\u8272(role)\u7684\u79cd\u7c7b<\/td><\/tr>
-u<\/td>\u5217\u51faSELinux\u6240\u6709\u8eab\u4efd\u8bc6\u522b(user)\u7684\u79cd\u7c7b<\/td><\/tr>
-b<\/td>\u5217\u51fa\u6240\u6709\u89c4\u5219\u7684\u79cd\u7c7b\uff08\u5e03\u5c14\u503c\uff09<\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u5217\u51faSELinux\u7684\u72b6\u6001\u3001\u89c4\u5219\u5e03\u5c14\u503c\u3001\u8eab\u4efd\u8bc6\u522b\u3001\u89d2\u8272\u3001\u7c7b\u578b\u7b49\u6240\u6709\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# seinfo -a<\/pre>\n\n\n\n

\u5217\u51faSELinux\u6240\u6709\u7c7b\u578b(type)\u7684\u79cd\u7c7b\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# seinfo -t<\/pre>\n\n\n\n

\u5217\u51faSELinux\u6240\u6709\u89d2\u8272(role)\u7684\u79cd\u7c7b\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# seinfo -r<\/pre>\n\n\n\n

\u5217\u51faSELinux\u6240\u6709\u8eab\u4efd\u8bc6\u522b(user)\u7684\u79cd\u7c7b\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# seinfo -u<\/pre>\n\n\n\n

\u5217\u51fa\u6240\u6709\u89c4\u5219\u7684\u79cd\u7c7b\uff08\u5e03\u5c14\u503c\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# seinfo -b<\/pre>\n\n\n\n

\u5217\u51fa\u4e0ehttpd\u6709\u5173\u7684\u89c4\u5219\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# seinfo -b | grep httpd<\/pre>\n\n\n\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

seinfo\u547d\u4ee4\u662f\u7528\u6765\u67e5\u8be2SELinux\u7684\u7b56\u7565\u63d0\u4f9b\u591a\u5c11\u76f8\u5173\u89c4\u5219\uff0c\u4e00\u4e2a\u4e3b\u4f53\u8fdb\u7a0b\u80fd\u5426\u8bfb\u53d6\u5230\u76ee\u6807\u6587\u4ef6\u8d44\u6e90\u7684\u91cd\u70b9\u662f\u5728\u4e8e […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4179"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=4179"}],"version-history":[{"count":8,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4179\/revisions"}],"predecessor-version":[{"id":4305,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4179\/revisions\/4305"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=4179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=4179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=4179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}