{"id":8480,"date":"2020-08-28T12:58:39","date_gmt":"2020-08-28T04:58:39","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=8480"},"modified":"2020-08-28T12:58:39","modified_gmt":"2020-08-28T04:58:39","slug":"matchpathcon","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/matchpathcon","title":{"rendered":"matchpathcon\u547d\u4ee4 – \u67e5\u770b\u6587\u4ef6\u9ed8\u8ba4\u5b89\u5168\u4e0a\u4e0b\u6587"},"content":{"rendered":"\n

matchpathcon\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u53ef\u4ee5\u5f97\u5230\u6307\u5b9a\u6587\u4ef6\u9ed8\u8ba4SELinux\u5b89\u5168\u4e0a\u4e0b\u6587\u3002<\/p>\n\n\n\n

\u76f8\u540c\u7684\u8def\u5f84\u53ef\u4ee5\u5177\u6709\u4e0d\u540c\u7684\u5b89\u5168\u6027\u4e0a\u4e0b\u6587\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u6587\u4ef6\u7c7b\u578b\u3002matchpathcon\u547d\u4ee4\u8fd8\u5c06\u5728\u786e\u5b9a\u9ed8\u8ba4\u5b89\u5168\u4e0a\u4e0b\u6587\u65f6\u7684\u6587\u4ef6\u7c7b\u578b\uff08\u5982\u679c\u6587\u4ef6\u5b58\u5728\uff09\u3002\u5982\u679c\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5219\u4e0d\u4f1a\u53d1\u751f\u6587\u4ef6\u7c7b\u578b\u5339\u914d\u3002<\/p>\n\n\n\n

\u5982\u679c\u7cfb\u7edf\u63d0\u793a\u6ca1\u6709\u5b89\u88c5matchpathcon\u547d\u4ee4\uff0c\u5219\u9700\u8981\u5148\u5b89\u88c5selinux-utils\u5de5\u5177\u5305\u3002<\/p>\n\n\n\n

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

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-p<\/td>\u4f7f\u7528\u524d\u7f00\u7684\u901f\u5ea6\u89e3\u7b54<\/td><\/tr>
-N<\/td>\u4e0d\u4f7f\u7528\u89e3\u7b54<\/td><\/tr>
-n<\/td>\u4e0d\u663e\u793a\u8def\u5f84<\/td><\/tr>
-V<\/td>\u5728\u78c1\u76d8\u5339\u914d\u9ed8\u8ba4\u4e0a\u9a8c\u8bc1\u6587\u4ef6\u4e0a\u4e0b\u6587<\/td><\/tr>
-f<file_context_file\u6587\u4ef6><\/td>\u4f7f\u7528\u5907\u7528file_context\u6587\u4ef6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

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

\u67e5\u770b\u6307\u5b9a\u6587\u4ef6\u7684\u9ed8\u8ba4\u5b89\u5168\u4e0a\u4e0b\u6587\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# matchpathcon \/root\/anaconda-ks.cfg<\/pre>\n\n\n\n

\u67e5\u770b\u6307\u5b9a\u6587\u4ef6\u7684\u9ed8\u8ba4\u5b89\u5168\u4e0a\u4e0b\uff0c\u4e0d\u663e\u793a\u6587\u4ef6\u8def\u5f84\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# matchpathcon -n \/root\/anaconda-ks.cfg<\/pre>\n\n\n\n

\u5728\u78c1\u76d8\u4e0a\u5339\u914d\u9ed8\u8ba4\u4e0a\u9a8c\u8bc1\u6587\u4ef6\u4e0a\u4e0b\u6587\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# matchpathcon -V \/root\/anaconda-ks.cfg<\/pre>\n","protected":false},"excerpt":{"rendered":"

matchpathcon\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u53ef\u4ee5\u5f97\u5230\u6307\u5b9a\u6587\u4ef6\u9ed8\u8ba4SELinux\u5b89\u5168\u4e0a\u4e0b\u6587\u3002 \u76f8\u540c\u7684\u8def\u5f84\u53ef\u4ee5\u5177\u6709\u4e0d\u540c\u7684\u5b89 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8480"}],"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=8480"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8480\/revisions"}],"predecessor-version":[{"id":8500,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8480\/revisions\/8500"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=8480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=8480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=8480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}