{"id":173955,"date":"2020-03-20T09:06:27","date_gmt":"2020-03-20T01:06:27","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=173955"},"modified":"2020-03-06T15:21:33","modified_gmt":"2020-03-06T07:21:33","slug":"linux-file-permession","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-file-permession.html","title":{"rendered":"Linux \u6587\u4ef6\u6743\u9650\u7ba1\u7406\u7684\u65b9\u6cd5"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728Linux\u7cfb\u7edf\u4e0b\uff0c\u4f7f\u7528\u6743\u9650\u6765\u4fdd\u62a4\u8d44\u6e90\u7684\u5b89\u5168\u5c06\u662f\u4e00\u79cd\u4e0d\u9519\u7684\u9009\u62e9\u3002\u7cfb\u7edf\u4e2d\u6bcf\u4e2a\u6587\u4ef6\u7684\u6743\u9650\u90fd\u6709\u53ef\u8bfb\uff08r\uff09\u3001\u53ef\u5199\uff08w\uff09\u548c\u53ef\u6267\u884c\uff08x\uff09\u8fd9\u4e09\u79cd\u6743\u9650\uff0c\u5b83\u4eec\u5206\u522b\u5bf9\u5e94\u6743\u9650\u6570\u503c4\u30012 \u548c1\u3002\u7cfb\u7edf\u4e3a\u6bcf\u4e2a\u6587\u4ef6\u548c\u76ee\u5f55\u90fd\u8bbe\u6709\u9ed8\u8ba4\u7684\u6743\u9650\uff0c\u6bcf\u4e2a\u6587\u4ef6\u4e2d\u53ef\u5206\u6709\u62e5\u6709\u8005\uff08u\uff09\u3001\u540c\u7fa4\u7ec4\u7684\u7528\u6237\uff08g\uff09\u548c\u5176\u4ed6\u7ec4\u7528\u6237\uff08o\uff09\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
1\uff0e\u6587\u4ef6\u6743\u9650\u7684\u6982\u8ff0<\/strong><\/div>\n

\u6587\u4ef6\u7684\u7c7b\u578b\u4e0d\u540c\uff0c\u6743\u9650\u5c31\u6709\u6240\u4e0d\u540c\uff0c\u867d\u7136\u6bcf\u4e2a\u6587\u4ef6\u7684\u6743\u9650\u90fd\u662f 777\uff0c\u4f46\u5728\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u65f6\uff0c\u5e76\u6ca1\u6709\u770b\u5230\u8be5\u6587\u4ef6\u7684\u6743\u9650\u662f777\uff0c\u8fd9\u662f\u7531\u4e8e\u63a9\u7801\u7684\u4f5c\u7528\u4f7f\u5f97\u67d0\u4e9b\u6743\u9650\u88ab\u5c4f\u853d\u3002<\/p>\n

\u5bf9\u4e8e\u6bcf\u4e2a\u6587\u4ef6\uff0c\u5176\u90fd\u7531\u4e0d\u540c\u7684\u4fe1\u606f\u7ec4\u6210\uff0c\u5982\u56fe\u6240\u793a\uff0c\u8fd9\u662f\u6211\u4eec\u4e4b\u524d\u521b\u5efa\u7684\u4e00\u4e2a\u540d\u4e3aCAT1\u7684\u7a7a\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\u5982\u4e0b\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u6587\u672c\u6587\u4ef6\u4e0e\u76ee\u5f55\u6587\u4ef6\u7684\u533a\u522b\u5c31\u5728\u4e8e\u7b2c\u4e00\u4e2a\u63cf\u8ff0\u7b26\u4e0d\u540c\uff0c\u76ee\u5f55\u5219\u4ee5\u201cd\u201d\u4e3a\u63cf\u8ff0\u7b26\u3002\u5982\u56fe\u6240\u793a\uff0c\u8fd9\u662f\u4e4b\u524d\u6240\u521b\u5efa\u7684\u4e00\u4e2a\u540d\u4e3aCAT\u7684\u76ee\u5f55\uff0c\u8be5\u76ee\u5f55\u7684\u8be6\u7ec6\u4fe1\u606f\u53ca\u76f8\u5173\u4ecb\u7ecd\u5982\u4e0b\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u4f7f\u7528\u5e26\u6709-l\u9009\u9879\u7684ls\u547d\u4ee4\uff0c\u53ef\u4ece\u8bb8\u53ef\u5b57\u7b26\u4e32\u7684\u9996\u5b57\u6bcd\u6765\u8bc6\u522b\u6240\u5217\u51fa\u6bcf\u4e2a\u6587\u4ef6\u7684\u7c7b\u578b\uff0c\u4ee5\u4e0b\u662f\u51e0\u4e2a\u5e38\u89c1\u7684\u6807\u8bc6\u53f7\u3002<\/p>\n

\u25cf-\uff1a\u4e00\u822c\u6587\u4ef6\uff08\u786c\u94fe\u63a5\uff09\u3002<\/p>\n

\u25cf l\uff1a\u7b26\u53f7\u94fe\u63a5\uff08\u8f6f\u94fe\u63a5\uff0c\u53ef\u4f7f\u7528\u5e26\u6709-s\u9009\u9879\u7684ln\u547d\u4ee4\u6765\u521b\u5efa\u4e00\u4e2a\u8f6f\u94fe\u63a5\uff09\u3002<\/p>\n

\u25cf d\uff1a\u76ee\u5f55\u3002<\/p>\n

\u25cf c\uff1a\u5b57\u7b26\u8bbe\u5907\u6587\u4ef6\u3002<\/p>\n

\u25cf p\uff1a\u547d\u540d\u7ba1\u9053\u3002<\/p>\n

\u25cf s\uff1a\u5957\u63a5\u5b57\u3002<\/p>\n

\u25cf b\uff1a\u5757\u8bbe\u5907\u7279\u6b8a\u6587\u4ef6\u3002<\/p>\n

2\uff0e\u6587\u4ef6\u6743\u9650\u7ba1\u7406<\/strong><\/div>\n

\u4ece\u521a\u521b\u5efa\u7684CAT1\u6587\u4ef6\u4e2d\u770b\u5230\uff0c\u8be5\u6587\u4ef6\u867d\u662fcat\u7528\u6237\u521b\u5efa\u7684\uff0c\u4f46cat\u7528\u6237\u5bf9\u8be5\u6587\u4ef6\u5e76\u6ca1\u6709\u53ef\u6267\u884c\u6743\u9650\u3002\u73b0\u5728\u8981\u4e3aCAT1\u6dfb\u52a0\u53ef\u6267\u884c\u6743\uff08x\uff09\uff0c\u5c06\u8fd9\u9879\u4efb\u52a1\u4ea4\u7ed9chmod\u547d\u4ee4\u5c31\u53ef\u4ee5\u3002\u4f7f\u7528chmod\u547d\u4ee4\u4e5f\u975e\u5e38\u7b80\u5355\uff0c\u5982\u4e0b\u6240\u793a\uff0c\u4e3acat\u7528\u6237\u6dfb\u52a0\u5bf9CAT1\u6587\u4ef6\u7684\u53ef\u6267\u884c\u6743\u3002<\/p>\n

[cat@cat \uff5e]$ chmod u+x CAT1<\/pre>\n

\u901a\u8fc7\u4ee5\u4e0a\u64cd\u4f5c\u540e\uff0ccat\u7528\u6237\u62e5\u6709\u4e86\u5bf9CAT1\u6587\u4ef6\u7684\u53ef\u6267\u884c\u6743\u3002\u5f53\u7136\uff0c\u8981\u6dfb\u52a0\u5176\u4ed6\u6743\u9650\u7684\u64cd\u4f5c\u4e5f\u5dee\u4e0d\u591a\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u201cchmod+rwx \u6587\u4ef6\u540d\u201d\u6765\u6388\u6743\u3002\u611f\u5174\u8da3\u7684\u8bfb\u8005\u53ef\u4ee5\u8bd5\u8bd5\uff0c\u8fd9\u91cc\u53ea\u8bb2\u65b9\u6cd5\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\u6765\u8fdb\u884c\u7ec3\u4e60\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u638c\u63e1\u3002<\/p>\n

\u5982\u679c\u5bf9CAT\u76ee\u5f55\u4e0b\u7684\u76ee\u5f55\u540c\u65f6\u6388\u4e88\u53ef\u6267\u884c\u6743\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u5e26\u6709-R\u9009\u9879\u7684Chmod\u547d\u4ee4\u8fdb\u884c\u64cd\u4f5c\uff0c\u5176\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

chmod\u2013R \u76ee\u5f55\u540d1\/\u76ee\u5f55\u540d2<\/p>\n

\u5176\u4e2d\u76ee\u5f552\u662f\u76ee\u5f551\u7684\u5b50\u76ee\u5f55\uff0c\u5373\u5728\u76ee\u5f551\u4e0b\u521b\u5efa\u76ee\u5f552\u3002<\/p>\n

\u4f7f\u7528-R\u9009\u9879\uff0c\u53ef\u9012\u5f52\u5730\u6388\u4e88\u5404\u79cd\u6743\u9650\u3002<\/p>\n

\u63a5\u4e0b\u6765\u8bb2\u89e3\u53d6\u6d88\u67d0\u4e2a\u7528\u6237\uff08\u6216\u7528\u6237\u7ec4\uff09\u62e5\u6709\u8be5\u6587\u4ef6\u7684\u6743\u9650\uff0c\u4f7f\u7528\u7684\u547d\u4ee4\u8fd8\u662fchmod\uff0c\u5982\u4e0b\u6240\u793a\uff0c\u53d6\u6d88cat\u7528\u6237\u5bf9\u6587\u4ef6CAT1\u62e5\u6709\u7684\u53ef\u6267\u884c\u6743\u3002<\/p>\n

[cat@cat \uff5e]$ chmod u-x CAT1<\/pre>\n

\u6839\u636e\u6587\u4ef6\u6743\u9650\u6570\u503c\uff0c4\u4ee3\u8868\u53ef\u8bfb\uff0c2\u4ee3\u8868\u53ef\u5199\uff0c\u800c1\u5219\u4ee3\u8868\u53ef\u6267\u884c\uff0c\u5e76\u4e14\u6743\u9650\u6570\u503c\u5b58\u5728\u65f6\u4ee51\u8868\u793a\uff0c\u5426\u5219\u5c31\u75280\u6765\u8868\u793a\uff08\u5b9e\u9645\u4e0a\u5c31\u662f\u7528\u4e8c\u8fdb\u5236\u7684\u65b9\u5f0f\u6765\u8868\u793a\uff09\uff0c\u5c31\u53ef\u4ee5\u5bf9\u4e8e\u67d0\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\u4e2d\u7684\u6743\u9650\u6570\u503c\u8ba1\u7b97\u3002\u5982\u56fe\u6240\u793a\uff0c\u8ba1\u7b97\u540d\u4e3aCAT1\u6587\u4ef6\u7684\u6743\u9650\u503c\u3002<\/p>\n

\"\"<\/p>\n

\u82e5\u9700\u8981\u5bf9\u8be5\u6587\u4ef6\u6388\u4e88\u6743\u9650\uff0c\u4e5f\u53ef\u4f7f\u7528\u201cchmod 664 CAT1\u201d\u7684\u5f62\u5f0f\u6765\u4e3a\u7528\u6237\u6388\u6743\u3002<\/p>\n

\u6709\u65f6\u4e3a\u4e86\u65b9\u4fbf\uff0c\u628a\u6587\u4ef6\u7684\u62e5\u6709\u6743\u6388\u4e88\u5176\u4ed6\u4eba\uff0c\u53ef\u4ee5\u4f7f\u7528chown\u6765\u6539\u53d8\u6587\u4ef6\u7684\u62e5\u6709\u8005\uff0c\u4e0b\u9762\u6f14\u793a\u5c06cat\u7528\u6237\u7684CAT1\u6587\u4ef6\u8f6c\u7ed9dog\u7528\u6237\uff0c\u5148\u5207\u6362\u5230root\u7528\u6237\uff0c\u7136\u540e\u624d\u53ef\u4ee5\u6267\u884c\u3002\u7531\u4e8eCAT1\u6587\u4ef6\u5728cat\u7528\u6237\u7684\u4e3b\u76ee\u5f55\u4e0b\uff0c\u56e0\u6b64\u4f7f\u7528\/home\/CAT1\u3002<\/p>\n

[root@cat \uff5e]# chown dog \/home\/cat\/CAT1<\/pre>\n

\u6267\u884c\u547d\u4ee4\u4e4b\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u5e26\u6709-l\u9009\u9879\u7684ls\u547d\u4ee4\u6765\u786e\u8ba4\u66f4\u6539\u6587\u4ef6\u62e5\u6709\u8005\u7684\u64cd\u4f5c\u662f\u5426\u6210\u529f\u3002\u5982\u4e0b\u547d\u4ee4\u663e\u793a\u66f4\u6539\u6587\u4ef6\u62e5\u6709\u8005\u4e4b\u540e\u8be5\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n

[cat@cat \uff5e]$ ls\u2013l\r\n\r\ntotal 0\r\n\r\n-rw-rw-r--\u30001\u3000dog\u3000cat\u30000 Aug\u30009\u300021:27\u3000CAT1<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u6587\u4ef6\u7684\u7c7b\u578b\u4e0d\u540c\uff0c\u6743\u9650\u5c31\u6709\u6240\u4e0d\u540c\uff0c\u867d\u7136\u6bcf\u4e2a\u6587\u4ef6\u7684\u6743\u9650\u90fd\u662f 777\uff0c\u4f46\u5728\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u65f6\uff0c\u5e76\u6ca1\u6709\u770b\u5230\u8be5\u6587\u4ef6\u7684\u6743\u9650\u662f7 […]<\/p>\n","protected":false},"author":310,"featured_media":173960,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-173955","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\/173955","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=173955"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/173955\/revisions"}],"predecessor-version":[{"id":174195,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/173955\/revisions\/174195"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/173960"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=173955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=173955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=173955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}