{"id":2629,"date":"2022-09-17T01:56:13","date_gmt":"2022-09-16T17:56:13","guid":{"rendered":"https:\/\/guerilla.ddns.net\/wp\/?p=2629"},"modified":"2025-08-24T01:32:40","modified_gmt":"2025-08-23T17:32:40","slug":"linux-%e4%b8%8b%e5%b0%87%e6%89%80%e6%9c%89%e7%9b%ae%e9%8c%84%e6%ac%8a%e9%99%90%e8%a8%ad%e6%88%90-755-%e6%aa%94%e6%a1%88%e6%ac%8a%e9%99%90%e8%a8%ad%e6%88%90-644","status":"publish","type":"post","link":"https:\/\/guerilla.ddns.net\/wp\/?p=2629","title":{"rendered":"Linux \u4e0b\u5c07\u6240\u6709\u76ee\u9304\u6b0a\u9650\u8a2d\u6210 755, \u6a94\u6848\u6b0a\u9650\u8a2d\u6210 644"},"content":{"rendered":"<p>\u9996\u5148\u5207\u63db\u5230\u8981\u8655\u7406\u7684\u76ee\u9304<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">cd \/home\/user\/public_html<\/code><\/pre>\n<p>&nbsp;<br \/>\n\u628a\u6240\u6709\u5e95\u4e0b\u7684\u76ee\u9304\u6b0a\u9650\u6539\u6210 755\uff0c\u6a94\u6848\u6b0a\u9650\u6539\u6210 644: (\u5305\u542b\u5b50\u76ee\u9304)<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">find . -type d -exec chmod 0755 {} \\;<\/code><\/pre>\n<pre><code class=\"language-bash\" data-line=\"\">find . -type f -exec chmod 0644 {} \\;<\/code><\/pre>\n<p>&nbsp;<br \/>\n\u4e5f\u53ef\u4ee5\u4f7f\u7528 xargs \u4f86\u5b8c\u6210 (\u807d\u8aaa\u66f4\u5feb\u4e9b)<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">find . -type d -print0 | xargs -0 chmod 755<\/code><\/pre>\n<pre><code class=\"language-bash\" data-line=\"\">find . -type f -print0 | xargs -0 chmod 644<\/code><\/pre>\n<p>&nbsp;<br \/>\nps: <strong>0755 = \u201crwxr-xr-x\u201d ; 644 = \u201crw-r\u2013r\u2013\u201c<\/strong><br \/>\n&nbsp;<\/p>\n<h4>\u5c0d\u65bc\u7279\u5b9a\u6a94\u6848\u7684\u8655\u7406<\/h4>\n<p>&nbsp;<br \/>\n\u82e5\u662f\u6211\u5011\u8981\u628a *.php \u6b0a\u9650\u6539\u6210 640<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">find . -type f -name &quot;*.php&quot; -exec chmod 0640 {} \\;<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<br \/>\nSource: <a href=\"https:\/\/tecadmin.net\/set-all-directories-to-755-and-all-files-to-644\/\" rel=\"noopener\" target=\"_blank\"><em>How to Set all directories to 755 And all files to 644<\/em><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u5207\u63db\u5230\u8981\u8655\u7406\u7684\u76ee\u9304 cd \/home\/user\/public_html &nbsp; \u628a\u6240\u6709\u5e95\u4e0b\u7684\u76ee\u9304\u6b0a\u9650 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[179],"tags":[2,63],"class_list":["post-2629","post","type-post","status-publish","format-standard","hentry","category-infotech","tag-apache","tag-linux"],"_links":{"self":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2629"}],"version-history":[{"count":6,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2629\/revisions"}],"predecessor-version":[{"id":3440,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2629\/revisions\/3440"}],"wp:attachment":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}