{"id":18930,"date":"2026-10-21T20:17:44","date_gmt":"2026-10-21T17:17:44","guid":{"rendered":"https:\/\/www.hyyat.com\/knowledgebase\/secure-file-permissions\/"},"modified":"2026-10-21T20:17:53","modified_gmt":"2026-10-21T17:17:53","password":"","slug":"secure-file-permissions","status":"publish","type":"docs","link":"https:\/\/www.hyyat.com\/en\/knowledgebase\/secure-file-permissions\/","title":{"rendered":"Secure File Permissions for Your Website: When to Use 644 and 755, and Why to Avoid 777"},"content":{"rendered":"<div class=\"hkb\" dir=\"ltr\">\n<div class=\"hkb-tldr\"><b>In short<\/b>Every file and folder on your site has a three-digit permission that decides who can read, write and execute it. The safe rule for most sites: folders 755, files 644 and wp-config.php 440 or 400. Never use 777, which lets anyone on the server modify the item; your site does not need it on our servers.<\/div>\n<figure class=\"hkb-fig\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/10\/hkb-file-permissions.webp\" alt=\"File permissions: a folder set to 755, files set to 644 and a lock\" width=\"1200\" height=\"630\" loading=\"lazy\" \/><\/figure>\n<h2>What do the numbers mean?<\/h2>\n<p>The first digit is for the owner, the second for the group and the third for everyone. Each digit is the sum of three values:<\/p>\n<div class=\"hkb-tbl\">\n<table>\n<thead>\n<tr>\n<th>Value<\/th>\n<th>Permission<\/th>\n<th>Meaning<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>4<\/td>\n<td>Read (r)<\/td>\n<td>View the file\u2019s contents or list the folder.<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>Write (w)<\/td>\n<td>Edit the file, or create and delete files in the folder.<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>Execute (x)<\/td>\n<td>Run the file, or enter the folder.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>For example, 644 means the owner reads and writes (4+2), the group only reads (4) and everyone only reads (4).<\/p>\n<h2>The right permissions for your site<\/h2>\n<div class=\"hkb-tbl\">\n<table>\n<thead>\n<tr>\n<th>Item<\/th>\n<th>Permission<\/th>\n<th>Why<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Folders<\/td>\n<td>755<\/td>\n<td>The account owner writes; the server enters and reads.<\/td>\n<\/tr>\n<tr>\n<td>Regular files<\/td>\n<td>644<\/td>\n<td>Read and served, edited only by the account owner.<\/td>\n<\/tr>\n<tr>\n<td>wp-config.php<\/td>\n<td>440 or 400<\/td>\n<td>The most important file, read only. Read <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/protect-wp-config\/\">protecting wp-config.php<\/a>.<\/td>\n<\/tr>\n<tr>\n<td>.htaccess<\/td>\n<td>644<\/td>\n<td>Read by the server, edited only by the account owner.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"hkb-note w\"><b>Why is 777 dangerous?<\/b> A 7 for everyone means any process on the server can modify the file or add a new file to the folder. If a plugin or old guide asks for 777, do not apply it. On our servers PHP runs as the account owner, so it writes to its files with 755 and 644 without needing 777.<\/div>\n<h2>How to change permissions<\/h2>\n<ol class=\"hkb-steps\">\n<li><b>In the cPanel File Manager:<\/b> Select the file or folder, click \u201cPermissions\u201d or \u201cChange Permissions\u201d, type the number and save.<\/li>\n<li><b>For a whole site with commands:<\/b> If Terminal is available in your account, go to the site folder and run the commands below.<\/li>\n<li><b>Check the site afterwards:<\/b> Open the home page and the dashboard and try uploading an image. If an error appears, open a ticket.<\/li>\n<\/ol>\n<pre class=\"hkb-code\">find . -type d -exec chmod 755 {} \\;\nfind . -type f -exec chmod 644 {} \\;\nchmod 440 wp-config.php<\/pre>\n<h2>Signs of a permission problem<\/h2>\n<ul class=\"hkb-list\">\n<li>A <code>403 Forbidden<\/code> message on a page or file: the permission is too low.<\/li>\n<li>A <code>500<\/code> error after changing permissions: some servers refuse to run PHP files writable by everyone.<\/li>\n<li>WordPress asks for FTP details when installing a plugin: file ownership is wrong; open a ticket and we will fix it.<\/li>\n<\/ul>\n<div class=\"hkb-hh\">\n<h2>How Hyyat Host protects your site<\/h2>\n<ul>\n<li><strong>CloudLinux<\/strong> places every account in its own environment, so no other account can see your files even at 644.<\/li>\n<li>PHP runs as the account owner, so no plugin or upload folder needs 777.<\/li>\n<li><strong>ImunifyAV<\/strong> scans files daily and detects new malicious files.<\/li>\n<\/ul>\n<\/div>\n<h2>Frequently asked questions<\/h2>\n<div class=\"hkb-faq\">\n<details>\n<summary>What permission should the uploads folder have?<\/summary>\n<p>755, like other folders. WordPress uploads images into it with this permission on our servers.<\/p>\n<\/details>\n<details>\n<summary>Do correct permissions prevent hacking?<\/summary>\n<p>They limit damage and close an important door, but they do not replace updates and strong passwords.<\/p>\n<\/details>\n<details>\n<summary>How do I see a file\u2019s permission?<\/summary>\n<p>The cPanel File Manager shows a Permissions column next to every file and folder.<\/p>\n<\/details>\n<\/div>\n<div class=\"hkb-rel\"><b>Related guides<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/protect-wp-config\/\">How to Protect wp-config.php in WordPress: 7 Steps to Secure Your Most Important File<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/website-malware-types\/\">Types of Website Malware and How to Recognise Each One<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/hacking-tools-c99-shell\/\">What Is a C99 Shell? How It Gets In and How to Find and Remove It<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/protect-website-from-hacking\/\">How to Protect Your Website from Hacking: 10 Practical Steps<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.hyyat.com\/en\/kb\/website-protection\/\">All website security guides \u2192<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In shortEvery file and folder on your site has a three-digit permission that decides who can read, write and execute it. The safe rule for most sites: folders 755, files 644 and wp-config.php 440 or 400. Never use 777, which lets anyone on the server modify the item; your site does not need it on [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"_templately_pack_id":"","_templately_imported_at":"","_templately_source":"","_templately_import_session_id":"","footnotes":""},"doc_category":[2744],"doc_tag":[],"class_list":["post-18930","docs","type-docs","status-publish","hentry","doc_category-website-protection"],"year_month":"2026-10","word_count":534,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"ahmed fathy","author_nicename":"ahmed-fathy","author_url":"https:\/\/www.hyyat.com\/en\/author\/ahmed-fathy\/"},"doc_category_info":[{"term_name":"Website Security","term_url":"https:\/\/www.hyyat.com\/en\/kb\/website-protection\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/18930","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/comments?post=18930"}],"version-history":[{"count":0,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/18930\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media?parent=18930"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_category?post=18930"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_tag?post=18930"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}