{"id":15493,"date":"2023-07-23T04:07:03","date_gmt":"2023-07-22T20:07:03","guid":{"rendered":"https:\/\/www.linuxcool.com\/lczxtcmldsyf"},"modified":"2023-07-23T04:07:03","modified_gmt":"2023-07-22T20:07:03","slug":"lczxtcmldsyf","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/lczxtcmldsyf","title":{"rendered":"Linux\u64cd\u4f5c\u7cfb\u7edfchown\u547d\u4ee4\u7684\u4f7f\u7528\u65b9\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879"},"content":{"rendered":"<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5728\u4f7f\u7528<a style='color:#0000CC' href='https:\/\/www.linuxprobe.com\/' target='_blank' rel=\"noopener\">Linux<\/a>\u64cd\u4f5c<a style='color:#0000CC' href='https:\/\/www.linuxdown.com\/' target='_blank' rel=\"noopener\">\u7cfb\u7edf<\/a>\u7684\u8fc7\u7a0b\u4e2dlinux\u7cfb\u7edf\u7f16\u7a0b\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230\u9700\u8981\u7ba1\u7406\u6587\u4ef6\u6743\u9650\u7684\u60c5\u51b5\u3002\u800cchown<a style='color:#0000CC' href='https:\/\/www.linuxcool.com\/' target='_blank' rel=\"noopener\">\u547d\u4ee4<\/a>\u5219\u662f\u4e00\u79cd\u975e\u5e38\u5b9e\u7528\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u66f4\u52a0\u7075\u6d3b\u5730\u63a7\u5236\u6587\u4ef6\u7684\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4\u3002\u901a\u8fc7\u4eb2\u8eab\u4f53\u9a8c\uff0c\u6211\u5c06\u4e3a\u5927\u5bb6\u8be6\u7ec6\u4ecb\u7ecdchown\u547d\u4ee4\u7684\u4f7f\u7528\u65b9\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>1.\u4e86\u89e3chown\u547d\u4ee4\u7684\u57fa\u672c\u6982\u5ff5<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5728\u5f00\u59cb\u4f7f\u7528chown\u547d\u4ee4\u4e4b\u524dlinux\u662f\u4ec0\u4e48\u7cfb\u7edf\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u4e86\u89e3\u5b83\u7684\u57fa\u672c\u6982\u5ff5\u3002chown\u662fchange owner\u7684\u7f29\u5199\uff0c\u7528\u4e8e\u6539\u53d8\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6240\u6709\u8005\u3002\u901a\u8fc7\u6307\u5b9a\u65b0\u7684\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4\uff0c\u6211\u4eec\u53ef\u4ee5\u7075\u6d3b\u5730\u7ba1\u7406\u6587\u4ef6\u7684\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>2.\u4f7f\u7528chown\u547d\u4ee4\u6539\u53d8\u6587\u4ef6\u6240\u6709\u8005<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8981\u6539\u53d8\u6587\u4ef6\u7684\u6240\u6709\u8005\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u683c\u5f0f\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>shell\nchown \u65b0\u6240\u6709\u8005\u6587\u4ef6\u540d\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4f8b\u5982\uff0c\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3atest.txt\u7684\u6587\u4ef6\uff0c\u73b0\u5728\u6211\u4eec\u60f3\u5c06\u5176\u6240\u6709\u6743\u8f6c\u79fb\u7ed9\u7528\u6237&#8221;john&#8221;\uff0c\u53ea\u9700\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>shell\nchown john test.txt\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>3.\u4f7f\u7528chown\u547d\u4ee4\u540c\u65f6\u6539\u53d8\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u9664\u4e86\u6539\u53d8\u6587\u4ef6\u7684\u6240\u6709\u8005\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u540c\u65f6\u6539\u53d8\u6587\u4ef6\u7684\u6240\u5c5e\u7ec4\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u683c\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>shell\nchown \u65b0\u6240\u6709\u8005:\u65b0\u6240\u5c5e\u7ec4\u6587\u4ef6\u540d\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4f8b\u5982\uff0c\u6211\u4eec\u60f3\u5c06test.txt\u7684\u6240\u6709\u8005\u6539\u4e3a&#8221;john&#8221;\uff0c\u6240\u5c5e\u7ec4\u6539\u4e3a&#8221;users&#8221;\uff0c\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>shell\nchown john:users test.txt\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>4.\u9012\u5f52\u4f7f\u7528chown\u547d\u4ee4<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6709\u65f6\u5019\u6211\u4eec\u9700\u8981\u540c\u65f6\u6539\u53d8\u4e00\u4e2a\u76ee\u5f55\u53ca\u5176\u5b50\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u7684\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4\u3002\u8fd9\u65f6<strong>linux\u4e2dchown\u547d\u4ee4<\/strong>\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u9012\u5f52\u9009\u9879&#8221;-R&#8221;\u6765\u5b9e\u73b0\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>shell\nchown -R\u65b0\u6240\u6709\u8005:\u65b0\u6240\u5c5e\u7ec4\u76ee\u5f55\u540d\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4f8b\u5982\uff0c\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3adata\u7684\u76ee\u5f55\uff0c\u91cc\u9762\u5305\u542b\u591a\u4e2a\u5b50\u76ee\u5f55\u548c\u6587\u4ef6\uff0c\u73b0\u5728\u6211\u4eec\u60f3\u5c06data\u76ee\u5f55\u53ca\u5176\u4e0b\u6240\u6709\u6587\u4ef6\u7684\u6240\u6709\u8005\u6539\u4e3a&#8221;john&#8221;\uff0c\u6240\u5c5e\u7ec4\u6539\u4e3a&#8221;users&#8221;<strong>linux\u4e2dchown\u547d\u4ee4<\/strong>\uff0c\u53ea\u9700\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>shell\nchown -R john:users data\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>5.\u4f7f\u7528chown\u547d\u4ee4\u65f6\u7684\u6ce8\u610f\u4e8b\u9879<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5728\u4f7f\u7528chown\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:350px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/07\/1690056423920_1.jpg' alt='\u547d\u4ee4\u4e2d\u7ed3\u6784\u6700\u7b80\u5355\u7684\u662f_\u547d\u4ee4\u4e2d\u7684\u53c2\u6570\u6709\u9519092400_linux\u4e2dchown\u547d\u4ee4' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>-\u53ea\u6709root\u7528\u6237\u6216\u6587\u4ef6\u7684\u6240\u6709\u8005\u624d\u80fd\u4f7f\u7528chown\u547d\u4ee4\u6765\u6539\u53d8\u6587\u4ef6\u7684\u6240\u6709\u8005\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>-- chown\u547d\u4ee4\u5bf9\u7b26\u53f7\u94fe\u63a5\u4e0d\u4f1a\u8fdb\u884c\u9012\u5f52\u64cd\u4f5c\uff0c\u53ea\u4f1a\u6539\u53d8\u7b26\u53f7\u94fe\u63a5\u672c\u8eab\u7684\u6240\u6709\u8005\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>-\u4fee\u6539\u6587\u4ef6\u7684\u6240\u6709\u8005\u53ef\u80fd\u4f1a\u5f71\u54cd\u5230\u5176\u4ed6\u7528\u6237\u5bf9\u8be5\u6587\u4ef6\u7684\u8bbf\u95ee\u6743\u9650\uff0c\u8bf7\u8c28\u614e\u64cd\u4f5c\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>6.\u5b9e\u9645\u6848\u4f8b\uff1a\u4fee\u6539\/var\/www\/html\u76ee\u5f55\u4e0b\u6587\u4ef6\u7684\u6240\u6709\u8005<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4f5c\u4e3a\u4e00\u4e2a\u7f51\u7ad9\u7ba1\u7406\u5458\uff0c\u6211\u7ecf\u5e38\u9700\u8981\u4fee\u6539\/var\/www\/html\u76ee\u5f55\u4e0b\u6587\u4ef6\u7684\u6240\u6709\u8005\uff0c\u4ee5\u786e\u4fdd\u7f51\u7ad9\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\u3002\u901a\u8fc7chown\u547d\u4ee4\uff0c\u6211\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>shell\nchown -R www-data:www-data \/var\/www\/html\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>7.\u603b\u7ed3<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u901a\u8fc7\u672c\u6587\u7684\u4eb2\u8eab\u4f53\u9a8c\uff0c\u6211\u4eec\u4e86\u89e3\u5230\u4e86chown\u547d\u4ee4\u5728Linux\u4e2d\u7684\u91cd\u8981\u6027\u548c\u4f7f\u7528\u65b9\u6cd5\u3002\u901a\u8fc7\u7075\u6d3b\u8fd0\u7528chown\u547d\u4ee4\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u7ba1\u7406\u6587\u4ef6\u7684\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4\uff0c\u786e\u4fdd\u7cfb\u7edf\u7684\u5b89\u5168\u6027\u548c\u7a33\u5b9a\u6027\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u5927\u5bb6\u5728Linux\u7cfb\u7edf\u7ba1\u7406\u4e2d\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u901a\u8fc7\u4ee5\u4e0a\u4e03\u70b9\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u6211\u4eec\u6df1\u5165\u4e86\u89e3\u4e86Linux\u4e2dchown\u547d\u4ee4\u7684\u4f7f\u7528\u65b9\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879\u3002\u901a\u8fc7\u4eb2\u8eab\u4f53\u9a8c\uff0c\u6211\u53d1\u73b0chown\u547d\u4ee4\u975e\u5e38\u5b9e\u7528\uff0c\u80fd\u591f\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u5730\u7ba1\u7406\u6587\u4ef6\u6743\u9650\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u6210\u529f\u5730\u6539\u53d8\u4e86\u6587\u4ef6\u7684\u6240\u6709\u8005\u548c\u6240\u5c5e\u7ec4\uff0c\u4fdd\u8bc1\u4e86\u7cfb\u7edf\u7684\u5b89\u5168\u6027\u548c\u7a33\u5b9a\u6027\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u5927\u5bb6\u5728Linux\u7cfb\u7edf\u7ba1\u7406\u4e2d\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f00\u59cb\u4f7f\u7528chown\u547d\u4ee4\u4e4b\u524d\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u4e86\u89e3\u5b83\u7684\u57fa\u672c\u6982\u5ff5\u3002\u4f7f\u7528chown\u547d\u4ee4\u6539\u53d8\u6587\u4ef6\u6240\u6709\u8005\u8981\u6539\u53d8\u6587\u4ef6\u7684\u6240\u6709\u8005\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u683c\u5f0f\uff1a\u4f7f\u7528chown\u547d\u4ee4\u65f6\u7684\u6ce8\u610f\u4e8b\u9879\u5728\u4f7f\u7528chown\u547d\u4ee4\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a-\u53ea\u6709root\u7528\u6237\u6216\u6587\u4ef6\u7684\u6240\u6709\u8005\u624d\u80fd\u4f7f\u7528chown\u547d\u4ee4\u6765\u6539\u53d8\u6587\u4ef6\u7684\u6240\u6709\u8005\u3002chown\u547d\u4ee4\u5bf9\u7b26\u53f7\u94fe\u63a5\u4e0d\u4f1a\u8fdb\u884c\u9012\u5f52\u64cd\u4f5c\uff0c\u53ea\u4f1a\u6539\u53d8\u7b26\u53f7\u94fe\u63a5\u672c\u8eab\u7684\u6240\u6709\u8005\u3002<\/p>\n","protected":false},"author":1,"featured_media":15494,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[766,23,46],"class_list":["post-15493","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge","tag-c-14","tag-lxt","tag-s-2"],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/15493","targetHints":{"allow":["GET"]}}],"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=15493"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/15493\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media\/15494"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=15493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=15493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=15493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}