{"id":2887,"date":"2025-08-27T18:30:10","date_gmt":"2025-08-27T09:30:10","guid":{"rendered":"https:\/\/wi-th.com\/?p=2887"},"modified":"2025-08-28T12:32:36","modified_gmt":"2025-08-28T03:32:36","slug":"wordpress-permissions-folder-file","status":"publish","type":"post","link":"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/","title":{"rendered":"WordPress Permissions (Folders, Files)"},"content":{"rendered":"<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Setting project permissions (folders, files) to Fixed<\/p>\n<\/blockquote>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#%EC%84%9C%EB%B2%84%EC%97%90_%EC%83%9D%EC%84%B1%EB%90%9C_%EA%B7%B8%EB%A3%B9%EB%B3%84_%EC%9D%98%EB%AF%B8\" >Meaning of groups created on the server<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#%F0%9F%94%8E_%EA%B7%B8%EB%A3%B9_%EB%AA%A9%EB%A1%9D_%ED%99%95%EC%9D%B8\" >\ud83d\udd0e Check the list of groups<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#%F0%9F%94%8E_%ED%8A%B9%EC%A0%95_%EA%B7%B8%EB%A3%B9%EC%97%90_%EC%96%B4%EB%96%A4_%EC%82%AC%EC%9A%A9%EC%9E%90%EA%B0%80_%EC%9E%88%EB%8A%94%EC%A7%80_%ED%99%95%EC%9D%B8\" >\ud83d\udd0e See which users are in a specific group<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#1_www-data%EB%A5%BC_webdev_%EA%B7%B8%EB%A3%B9%EC%97%90_%EC%B6%94%EA%B0%80_%ED%99%95%EC%9D%B8\" >1) Add www-data to the webdev group + OK<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#%F0%9F%94%8E_%ED%98%84%EC%9E%AC_%EC%82%AC%EC%9A%A9%EC%9E%90%EA%B0%80_%EC%86%8D%ED%95%9C_%EB%AA%A8%EB%93%A0_%EA%B7%B8%EB%A3%B9_%ED%99%95%EC%9D%B8\" >\ud83d\udd0e See all groups the current user belongs to<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#%E2%9C%85_%EA%B3%A0%EC%A0%95_%ED%8F%B4%EB%8D%94_%EA%B6%8C%ED%95%9C%EC%84%A4%EC%A0%95_%ED%91%9C%EC%A4%80\" >\u2705 Fixed folder permissions standard<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#1_projects_%EA%B6%8C%ED%95%9C%EC%84%A4%EC%A0%95\" >1) Set projects permissions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#2_%EB%B0%94%EB%A1%9C_%EC%9D%BD%EA%B8%B0_%ED%85%8C%EC%8A%A4%ED%8A%B8_%EA%B6%8C%ED%95%9C%EC%84%A4%EC%A0%95_OK_%EC%97%AC%EB%B6%80_%EC%A6%89%EC%8B%9C_%ED%99%95%EC%9D%B8\" >2) Instant Read Test (immediately check if permissions are OK)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/#%F0%9F%93%8C_%EA%B4%80%EB%A6%AC_%EB%B0%A9%EB%B2%95\" >\ud83d\udccc How to manage<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%EC%84%9C%EB%B2%84%EC%97%90_%EC%83%9D%EC%84%B1%EB%90%9C_%EA%B7%B8%EB%A3%B9%EB%B3%84_%EC%9D%98%EB%AF%B8\"><\/span>Meaning of groups created on the server<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>UserAccounts: Primary account only group (auto-generated, required)<\/li>\n\n\n\n<li><strong>adm<\/strong> : Permission to view system logs (usually required for administrator accounts, not needed for normal operations)<\/li>\n\n\n\n<li><strong>cdrom<\/strong> Access to a CD\/DVD device (not necessary these days unless you have a CD-ROM on your server)<\/li>\n\n\n\n<li><strong>sudo<\/strong> : Use administrator privileges (required)<\/li>\n\n\n\n<li><strong>dip<\/strong> : Dialup\/PPP network related (for old modems, rarely needed)<\/li>\n\n\n\n<li><strong>www-data<\/strong> : Webserver account group (Debian\/Ubuntu Apache-Nginx default)<\/li>\n\n\n\n<li><strong>plugdev<\/strong> Access to hotplug devices like USB (not necessary if the server doesn't use USB)<\/li>\n\n\n\n<li><strong>lpadmin<\/strong> : Printer Manager (not necessary if you don't use printers on the server)<\/li>\n\n\n\n<li><strong>lxd<\/strong> : Manage LXD\/LXC containers (not necessary if you don't use Proxmox or LXD directly)<\/li>\n\n\n\n<li><strong>sambashare<\/strong> : Access to Samba shared directories (not necessary if you don't use Windows sharing)<\/li>\n\n\n\n<li><strong>docker<\/strong> : Docker administrative privileges (required for Docker write)<\/li>\n\n\n\n<li><strong>www<\/strong> : When installing aaPanel, there is a case of using the web server account (need to confirm the account running OpenLiteSpeed\/Nginx)<\/li>\n\n\n\n<li><strong>webdev<\/strong> : Group created by yourself (user_group + www tied together to manage web development, highly recommended \u2705)<\/li>\n<\/ul>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%F0%9F%94%8E_%EA%B7%B8%EB%A3%B9_%EB%AA%A9%EB%A1%9D_%ED%99%95%EC%9D%B8\"><\/span>\ud83d\udd0e Check the list of groups<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># View a list of all groups\ncat \/etc\/group<\/code><\/pre>\n\n\n\n<p>\ud83d\udc49 This file contains the <code>GroupName:x:GID:User1,User2,...<\/code> It should look something like this.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%F0%9F%94%8E_%ED%8A%B9%EC%A0%95_%EA%B7%B8%EB%A3%B9%EC%97%90_%EC%96%B4%EB%96%A4_%EC%82%AC%EC%9A%A9%EC%9E%90%EA%B0%80_%EC%9E%88%EB%8A%94%EC%A7%80_%ED%99%95%EC%9D%B8\"><\/span>\ud83d\udd0e See which users are in a specific group<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># Example: The webdev group\ngetent group webdev<\/code><\/pre>\n\n\n\n<p>Example output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>webdev:x:1002:user_group,www<\/code><\/pre>\n\n\n\n<p>\u2192 In the webdev group <code>user_group<\/code>, <code>www<\/code> is included.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_www-data%EB%A5%BC_webdev_%EA%B7%B8%EB%A3%B9%EC%97%90_%EC%B6%94%EA%B0%80_%ED%99%95%EC%9D%B8\"><\/span>1) Add www-data to the webdev group + OK<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Add the # group\nsudo usermod -aG webdev www-data\n\nRestart PHP-FPM to reflect #\n\nVerify that # www-data is in webdev\nid www-data\n# \u2192 webdev should be visible in the groups list<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%F0%9F%94%8E_%ED%98%84%EC%9E%AC_%EC%82%AC%EC%9A%A9%EC%9E%90%EA%B0%80_%EC%86%8D%ED%95%9C_%EB%AA%A8%EB%93%A0_%EA%B7%B8%EB%A3%B9_%ED%99%95%EC%9D%B8\"><\/span>\ud83d\udd0e See all groups the current user belongs to<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>groups user_group<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E2%9C%85_%EA%B3%A0%EC%A0%95_%ED%8F%B4%EB%8D%94_%EA%B6%8C%ED%95%9C%EC%84%A4%EC%A0%95_%ED%91%9C%EC%A4%80\"><\/span>\u2705 Fixed folder permissions standard<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Owner<\/strong>: user_group<\/li>\n\n\n\n<li><strong>Groups<\/strong>: <code>webdev<\/code><\/li>\n\n\n\n<li><strong>Directory<\/strong>: <code>2775<\/code> (including setgid \u2192 new ones are also automatically added to the <code>webdev<\/code>)<\/li>\n\n\n\n<li><strong>File<\/strong>: <code>664<\/code><\/li>\n\n\n\n<li><strong>Special Files<\/strong>: <code>wp-config.php<\/code> \u2192 \u0392 <code>640<\/code><\/li>\n\n\n\n<li><strong>Special Folders<\/strong>: <code>wp-content\/uploads<\/code>, <code>wp-content\/plugins<\/code>, <code>wp-content\/themes<\/code> \u2192 \u0392 <code>775<\/code> Keep<\/li>\n<\/ul>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_projects_%EA%B6%8C%ED%95%9C%EC%84%A4%EC%A0%95\"><\/span>1) Set projects permissions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/www\/wwwroot\/projects\n\nChange the # owner\/group\nsudo chown -R user_group:webdev .\n\nFix # folder permissions\nsudo find . -type d -exec chmod 2775 {} \\;\n\nFix # file permissions\nsudo find . -type f -exec chmod 664 {} \\;\n\n# Secure wp-config.php\nsudo chmod 640 wp-config.php\n\n# wp-content write folder\nsudo chmod -R 775 wp-content\/uploads wp-content\/plugins wp-content\/themes<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_%EB%B0%94%EB%A1%9C_%EC%9D%BD%EA%B8%B0_%ED%85%8C%EC%8A%A4%ED%8A%B8_%EA%B6%8C%ED%95%9C%EC%84%A4%EC%A0%95_OK_%EC%97%AC%EB%B6%80_%EC%A6%89%EC%8B%9C_%ED%99%95%EC%9D%B8\"><\/span>2) Instant Read Test (immediately check if permissions are OK)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># Attempt to read wp-config.php with www-data permissions\nsudo -u www-data head -n 3 \/www\/wwwroot\/projects\/wp-config.php\nIf you see the content without # errors, you're good to go<\/code><\/pre>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%F0%9F%93%8C_%EA%B4%80%EB%A6%AC_%EB%B0%A9%EB%B2%95\"><\/span>\ud83d\udccc How to manage<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When installing a new WordPress project, run the same set of commands as above \u2192 Run the <strong>Setting fixed permissions<\/strong> Setup complete.<\/li>\n\n\n\n<li>The permissions are <strong>No Dev\/Ops separation<\/strong>.<\/li>\n\n\n\n<li>If you need to make a manual fix during production, just use the <code>user_group<\/code> Sign in to your account \u2192 click <code>webdev<\/code> No problem, thanks to group permissions.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"970\" height=\"90\" src=\"https:\/\/wi-th.com\/wp-content\/uploads\/2025\/08\/in-te-ri-or_logo_1.png\" alt=\"Permission Settings \u24d2 wi-th.com\" class=\"wp-image-2906\" srcset=\"\/\/wi-th.com\/wp-content\/uploads\/2025\/08\/in-te-ri-or_logo_1.png 970w, \/\/wi-th.com\/wp-content\/uploads\/2025\/08\/in-te-ri-or_logo_1-665x62.png 665w, \/\/wi-th.com\/wp-content\/uploads\/2025\/08\/in-te-ri-or_logo_1-300x28.png 300w, \/\/wi-th.com\/wp-content\/uploads\/2025\/08\/in-te-ri-or_logo_1-768x71.png 768w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><figcaption class=\"wp-element-caption\">All things interior <a href=\"http:\/\/dknock.in-te-ri-or.com\" data-type=\"link\" data-id=\"dknock.in-te-ri-or.com\" target=\"_blank\" rel=\"noopener\">In-The-Rear.com<\/a><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"970\" height=\"90\" src=\"https:\/\/wi-th.com\/wp-content\/uploads\/2025\/08\/dknock_banner_1.png\" alt=\"Permissions \u24d2 dknock.in-te-ri-or.com\" class=\"wp-image-2924\" srcset=\"\/\/wi-th.com\/wp-content\/uploads\/2025\/08\/dknock_banner_1.png 970w, \/\/wi-th.com\/wp-content\/uploads\/2025\/08\/dknock_banner_1-665x62.png 665w, \/\/wi-th.com\/wp-content\/uploads\/2025\/08\/dknock_banner_1-300x28.png 300w, \/\/wi-th.com\/wp-content\/uploads\/2025\/08\/dknock_banner_1-768x71.png 768w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><figcaption class=\"wp-element-caption\">Interior specialists \u24d2 <a href=\"http:\/\/dknock.in-te-ri-or.com\" data-type=\"link\" data-id=\"dknock.in-te-ri-or.com\" target=\"_blank\" rel=\"noopener\">dknock<\/a><\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-align-center\">\u0392 <a href=\"https:\/\/wi-th.com\/en\/\">Weed<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\ud504\ub85c\uc81d\ud2b8 \uad8c\ud55c\uc124\uc815(\ud3f4\ub354, \ud30c\uc77c)\uc744 \uace0\uc815\uc73c\ub85c \uc124\uc815\ud558\uae30 \uc11c\ubc84\uc5d0 \uc0dd\uc131\ub41c \uadf8\ub8f9\ubcc4 \uc758\ubbf8 \ud83d\udd0e \uadf8\ub8f9 \ubaa9\ub85d \ud655\uc778 \ud83d\udc49 \uc774 \ud30c\uc77c\uc5d0\ub294 \uadf8\ub8f9\uba85:x:GID:\uc0ac\uc6a9\uc7901,\uc0ac\uc6a9\uc7902,&#8230; \uc774\ub7f0 \ud615\ud0dc\ub85c \ucb49 \ub098\uc640\uc694. \ud83d\udd0e \ud2b9\uc815 \uadf8\ub8f9\uc5d0 \uc5b4\ub5a4 <a href=\"https:\/\/wi-th.com\/en\/it\/wordpress-permissions-folder-file\/\" class=\"read-more-link\">[more&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[417,418],"tags":[415],"class_list":["post-2887","post","type-post","status-publish","format-standard","hentry","category-it","category-418","tag-415"],"_links":{"self":[{"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/posts\/2887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/comments?post=2887"}],"version-history":[{"count":0,"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/posts\/2887\/revisions"}],"wp:attachment":[{"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/media?parent=2887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/categories?post=2887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wi-th.com\/en\/wp-json\/wp\/v2\/tags?post=2887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}