{"id":216,"date":"2026-06-02T23:12:12","date_gmt":"2026-06-03T06:12:12","guid":{"rendered":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/"},"modified":"2026-06-02T23:12:12","modified_gmt":"2026-06-03T06:12:12","slug":"fix-permission-denied-error-linux-chmod-chown","status":"publish","type":"post","link":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/","title":{"rendered":"How to Fix &#8220;Permission Denied&#8221; Errors on Linux: chmod and chown Explained"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>The <code class=\"\" data-line=\"\">Permission Denied<\/code> error is one of the most common things you&#8217;ll run into on a Linux server. It means the user or process trying to access a file doesn&#8217;t have the rights to do so \u2014 either because the file&#8217;s ownership is wrong, the permission bits aren&#8217;t set correctly, or both. Linux permissions control everything: who can read a file, write to it, or execute it.<\/p>\n<p>On a web hosting server, this usually surfaces when you upload files via FTP, restore a backup, run a PHP script, or switch between users. The web server process (typically <code class=\"\" data-line=\"\">www-data<\/code>, <code class=\"\" data-line=\"\">apache<\/code>, or <code class=\"\" data-line=\"\">nobody<\/code> depending on your stack) can&#8217;t access your files because they&#8217;re owned by a different user. If you&#8217;re on a <a href=\"https:\/\/www.hostandtech.com\/vps-ssd-servers\">VPS SSD Hosting<\/a> plan or a dedicated server, you&#8217;ll have the root access needed to fix these properly \u2014 shared hosting users may need to work within cPanel&#8217;s File Manager or contact support.<\/p>\n<p>This article covers how to read Linux file permissions, how to fix ownership with <code class=\"\" data-line=\"\">chown<\/code>, how to set correct permission modes with <code class=\"\" data-line=\"\">chmod<\/code>, and what to do when the obvious fix doesn&#8217;t work.<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>SSH access to your server (root or sudo user), <strong>or<\/strong> access to cPanel File Manager<\/li>\n<li>Basic familiarity with a terminal \u2014 you don&#8217;t need to be an expert, but you&#8217;ll need to run commands<\/li>\n<li>Knowledge of which user your web server runs as (common values: <code class=\"\" data-line=\"\">www-data<\/code> on Ubuntu\/Debian, <code class=\"\" data-line=\"\">apache<\/code> on CentOS\/AlmaLinux, <code class=\"\" data-line=\"\">nobody<\/code> on some cPanel stacks)<\/li>\n<li>The path to the file or directory causing the error<\/li>\n<\/ul>\n<h2>Step 1 \u2014 Read the Current Permissions<\/h2>\n<p>Before changing anything, check what the permissions actually are. Run <code class=\"\" data-line=\"\">ls -la<\/code> on the file or directory in question. The <code class=\"\" data-line=\"\">-a<\/code> flag shows hidden files, and <code class=\"\" data-line=\"\">-l<\/code> gives the long format with permissions visible.<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-1\"><code class=\"\" data-line=\"\">ls -la \/var\/www\/html\/mysite\/<\/code><\/pre>\n<\/div>\n<p>You&#8217;ll see output like this:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-2\"><code class=\"\" data-line=\"\">drwxr-xr-x  3 root     root     4096 Jan 10 09:15 mysite\n-rw-r--r--  1 root     root     1234 Jan 10 09:15 index.php\n-rw-------  1 root     root      512 Jan 10 09:15 config.php<\/code><\/pre>\n<\/div>\n<p>Here&#8217;s how to read those permission strings:<\/p>\n<ul>\n<li>The first character is the type: <code class=\"\" data-line=\"\">d<\/code> = directory, <code class=\"\" data-line=\"\">-<\/code> = file, <code class=\"\" data-line=\"\">l<\/code> = symlink<\/li>\n<li>The next 9 characters are three groups of three: <strong>owner<\/strong>, <strong>group<\/strong>, <strong>others<\/strong><\/li>\n<li>Each group: <code class=\"\" data-line=\"\">r<\/code> = read, <code class=\"\" data-line=\"\">w<\/code> = write, <code class=\"\" data-line=\"\">x<\/code> = execute (or <code class=\"\" data-line=\"\">-<\/code> if not set)<\/li>\n<li>The two columns after the permissions show the <strong>owner<\/strong> and <strong>group<\/strong><\/li>\n<\/ul>\n<p>In the example above, <code class=\"\" data-line=\"\">config.php<\/code> is set to <code class=\"\" data-line=\"\">rw-------<\/code>, meaning only <code class=\"\" data-line=\"\">root<\/code> can read or write it. If your web server process is running as <code class=\"\" data-line=\"\">www-data<\/code>, it&#8217;ll get a Permission Denied error trying to read that file.<\/p>\n<h2>Step 2 \u2014 Fix Ownership with chown<\/h2>\n<p><code class=\"\" data-line=\"\">chown<\/code> changes who owns a file or directory. This is often the actual fix when your web server can&#8217;t access files you uploaded as a different user.<\/p>\n<p>To change the owner of a single file:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-3\"><code class=\"\" data-line=\"\">sudo chown www-data:www-data \/var\/www\/html\/mysite\/config.php<\/code><\/pre>\n<\/div>\n<p>To change ownership recursively for an entire directory (use with care \u2014 see the warning below):<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-4\"><code class=\"\" data-line=\"\">sudo chown -R www-data:www-data \/var\/www\/html\/mysite\/<\/code><\/pre>\n<\/div>\n<p>The format is <code class=\"\" data-line=\"\">chown user:group<\/code>. You can omit the group if you only need to change the owner: <code class=\"\" data-line=\"\">chown www-data file.php<\/code>.<\/p>\n<p>\ud83d\udcdd <strong>Note:<\/strong> On cPanel servers, files are typically owned by the cPanel account username (e.g., <code class=\"\" data-line=\"\">myaccount<\/code>) rather than <code class=\"\" data-line=\"\">www-data<\/code>. Check your actual username with <code class=\"\" data-line=\"\">whoami<\/code> and use that instead.<\/p>\n<p>\u26a0 <strong>Warning:<\/strong> Running <code class=\"\" data-line=\"\">chown -R root:root \/var\/www\/<\/code> recursively as root will break your site \u2014 your web server won&#8217;t be able to read anything. Always double-check the user and path before using <code class=\"\" data-line=\"\">-R<\/code>.<\/p>\n<h2>Step 3 \u2014 Fix Permission Bits with chmod<\/h2>\n<p>Even with correct ownership, wrong permission bits will still cause denials. <code class=\"\" data-line=\"\">chmod<\/code> sets what the owner, group, and others are allowed to do with a file.<\/p>\n<p>For most web hosting scenarios, you want:<\/p>\n<ul>\n<li><strong>Files:<\/strong> <code class=\"\" data-line=\"\">644<\/code> \u2014 owner can read\/write, group and others can read only<\/li>\n<li><strong>Directories:<\/strong> <code class=\"\" data-line=\"\">755<\/code> \u2014 owner can read\/write\/enter, group and others can read and enter<\/li>\n<li><strong>Scripts that need to execute:<\/strong> <code class=\"\" data-line=\"\">755<\/code><\/li>\n<li><strong>Sensitive config files (e.g., wp-config.php):<\/strong> <code class=\"\" data-line=\"\">640<\/code> or <code class=\"\" data-line=\"\">600<\/code><\/li>\n<\/ul>\n<p>To set permissions on a single file:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-5\"><code class=\"\" data-line=\"\">sudo chmod 644 \/var\/www\/html\/mysite\/index.php<\/code><\/pre>\n<\/div>\n<p>To fix an entire site&#8217;s files and directories at once \u2014 this is something I use regularly after restoring backups:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-6\"><code class=\"\" data-line=\"\"># Set all files to 644\nfind \/var\/www\/html\/mysite -type f -exec chmod 644 {} ;\n\n# Set all directories to 755\nfind \/var\/www\/html\/mysite -type d -exec chmod 755 {} ;<\/code><\/pre>\n<\/div>\n<p>\ud83d\udcdd <strong>Note:<\/strong> The numbers in chmod are octal. <code class=\"\" data-line=\"\">644<\/code> means: owner gets 4+2=6 (read+write), group gets 4 (read), others get 4 (read). You don&#8217;t need to memorise the math, but knowing <code class=\"\" data-line=\"\">7=full<\/code>, <code class=\"\" data-line=\"\">6=read\/write<\/code>, <code class=\"\" data-line=\"\">5=read\/execute<\/code>, <code class=\"\" data-line=\"\">4=read only<\/code> covers 95% of cases.<\/p>\n<p>\u26a0 <strong>Warning:<\/strong> Don&#8217;t set directories or files to <code class=\"\" data-line=\"\">777<\/code> unless you fully understand the implications. It grants write access to every user on the server, which is a serious security risk \u2014 especially on shared hosting environments.<\/p>\n<h2>Step 4 \u2014 Verify the Fix<\/h2>\n<p>After making changes, recheck with <code class=\"\" data-line=\"\">ls -la<\/code> and test your application. If it&#8217;s a web app, reload the page. If it&#8217;s a script, run it again.<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-7\"><code class=\"\" data-line=\"\">ls -la \/var\/www\/html\/mysite\/config.php<\/code><\/pre>\n<\/div>\n<p>Expected output (for a file owned by www-data with 640 permissions):<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-8\"><code class=\"\" data-line=\"\">-rw-r-----  1 www-data www-data  512 Jan 10 09:15 config.php<\/code><\/pre>\n<\/div>\n<p>If you&#8217;re still seeing permission errors after fixing ownership and chmod, jump to the troubleshooting section below \u2014 there are a few less obvious causes.<\/p>\n<h2>Common Issues &amp; Troubleshooting<\/h2>\n<h3>Still Getting &#8220;Permission Denied&#8221; After Running chmod<\/h3>\n<p><strong>Cause:<\/strong> The file might be on a filesystem mounted with the <code class=\"\" data-line=\"\">noexec<\/code> or <code class=\"\" data-line=\"\">nosuid<\/code> option, or there&#8217;s an SELinux\/AppArmor policy blocking access regardless of standard Unix permissions.<\/p>\n<p><strong>Fix:<\/strong> Check mount options with <code class=\"\" data-line=\"\">cat \/proc\/mounts<\/code>. For SELinux, check with <code class=\"\" data-line=\"\">sestatus<\/code> and look at audit logs in <code class=\"\" data-line=\"\">\/var\/log\/audit\/audit.log<\/code>. For AppArmor, check <code class=\"\" data-line=\"\">aa-status<\/code>. These security layers operate independently of standard Linux permissions \u2014 chmod alone won&#8217;t help.<\/p>\n<h3>PHP Script Returns 500 Error or &#8220;open_basedir restriction&#8221; Instead of Running<\/h3>\n<p><strong>Cause:<\/strong> PHP&#8217;s <code class=\"\" data-line=\"\">open_basedir<\/code> directive restricts which directories PHP can access, regardless of file system permissions. This is separate from Linux permissions entirely.<\/p>\n<p><strong>Fix:<\/strong> Check your PHP configuration \u2014 either in <code class=\"\" data-line=\"\">php.ini<\/code>, a <code class=\"\" data-line=\"\">.htaccess<\/code> directive, or in WHM under <em>Service Configuration &gt; PHP Configuration Editor<\/em>. Make sure your file path falls within the allowed directories.<\/p>\n<h3>&#8220;Operation Not Permitted&#8221; When Running chown as a Non-Root User<\/h3>\n<p><strong>Cause:<\/strong> On Linux, only root can change a file&#8217;s owner to another user. If you&#8217;re running <code class=\"\" data-line=\"\">chown<\/code> without <code class=\"\" data-line=\"\">sudo<\/code> and you&#8217;re not root, you&#8217;ll get this error. Regular users can only change group ownership to a group they&#8217;re already a member of.<\/p>\n<p><strong>Fix:<\/strong> Prefix with <code class=\"\" data-line=\"\">sudo<\/code>, or switch to root with <code class=\"\" data-line=\"\">sudo -i<\/code>. If you&#8217;re on shared hosting without root access, use cPanel&#8217;s File Manager \u2014 it runs permission changes as root on your behalf.<\/p>\n<h3>WordPress Can&#8217;t Write to wp-content After Uploading Files via FTP<\/h3>\n<p><strong>Cause:<\/strong> FTP uploads create files owned by your FTP user, not the web server user. WordPress needs write access to <code class=\"\" data-line=\"\">wp-content\/uploads<\/code> to handle media uploads.<\/p>\n<p><strong>Fix:<\/strong> Either change ownership of <code class=\"\" data-line=\"\">wp-content<\/code> to the web server user (e.g., <code class=\"\" data-line=\"\">www-data<\/code>), or set it to <code class=\"\" data-line=\"\">775<\/code> and add your FTP user to the web server&#8217;s group. I&#8217;d recommend the ownership approach on any server you control:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-9\"><code class=\"\" data-line=\"\">sudo chown -R www-data:www-data \/var\/www\/html\/wordpress\/wp-content\/\nsudo chmod -R 755 \/var\/www\/html\/wordpress\/wp-content\/\nsudo chmod -R 775 \/var\/www\/html\/wordpress\/wp-content\/uploads\/<\/code><\/pre>\n<\/div>\n<h3>Permissions Look Correct but SSH Key Login Fails with &#8220;Permission Denied&#8221;<\/h3>\n<p><strong>Cause:<\/strong> SSH is extremely strict about permissions on your <code class=\"\" data-line=\"\">~\/.ssh<\/code> directory and <code class=\"\" data-line=\"\">authorized_keys<\/code> file. If these are group- or world-writable, SSH will silently reject the key \u2014 this trips up a lot of people because the permissions look fine at a glance.<\/p>\n<p><strong>Fix:<\/strong> Set the exact permissions SSH requires:<\/p>\n<div class=\"ht-code-snippet\"><button class=\"ht-code-snippet__copy\" type=\"button\" aria-label=\"Copy code\"><\/button><span class=\"ht-code-snippet__feedback\">Copied to clipboard<\/span><\/p>\n<pre class=\"ht-code-snippet__code\" id=\"code-block-10\"><code class=\"\" data-line=\"\">chmod 700 ~\/.ssh\nchmod 600 ~\/.ssh\/authorized_keys<\/code><\/pre>\n<\/div>\n<h2>FAQ<\/h2>\n<div class=\"ht-faq-section\">\n<h2>Frequently Asked Questions<\/h2>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">What&#039;s the difference between chmod and chown?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>chown changes who owns a file \u2014 the user and group assigned to it. chmod changes what that owner (and everyone else) is allowed to do with the file, like read, write, or execute it. When you get a Permission Denied error, you usually need to check both: the right user needs to own the file, and the permission bits need to allow that user to access it.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">Is it safe to use chmod 777 on my web files?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>No, and I&#8217;d strongly advise against it. chmod 777 gives every user on the server full read, write, and execute access to that file. On a shared hosting environment especially, that&#8217;s a genuine security risk \u2014 other accounts could modify or read your files. Use 644 for files and 755 for directories in almost all web hosting situations.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">How do I find all files with wrong permissions on my Linux server?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>You can use the find command to locate files that don&#8217;t match expected permissions. For example, to find files that are world-writable: <code class=\"\" data-line=\"\">find \/var\/www\/html -type f -perm -o+w<\/code>. To find files that are readable by everyone but shouldn&#8217;t be (like config files), check for 644 or higher where you expected 640 or 600.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">Can I fix file permissions from cPanel without SSH?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>Yes. In cPanel, go to Files &gt; File Manager, navigate to the file or directory, right-click it, and select Change Permissions. You&#8217;ll see checkboxes for read, write, and execute for owner, group, and world. It&#8217;s less flexible than the command line but works fine for one-off fixes. For bulk changes across a whole site, SSH is much faster.<\/p>\n<\/div>\n<\/div>\n<div class=\"ht-faq-item\">\n<h3 class=\"ht-faq-question\">Why do my file permissions reset after I fix them?<\/h3>\n<div class=\"ht-faq-answer\">\n<p>This usually means something is overwriting them \u2014 a deployment script, a CMS auto-update process, or a backup restore. Check whether you have any automated processes running (cron jobs, CI\/CD pipelines, cPanel backup restores) that might be re-uploading or extracting files. Fixing the permissions in that script or process is the permanent solution, not manually resetting them each time.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Getting a &#8216;Permission Denied&#8217; error on Linux usually means a file or directory has the wrong ownership or permissions \u2014 and it&#8217;s almost always fixable in under five minutes. This guide walks you through diagnosing and correcting Linux permissions using chmod and chown, with real hosting examples.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[49],"tags":[585,586,588,584,590,54,587,589],"class_list":["post-216","post","type-post","status-publish","format-standard","hentry","category-linux","tag-chmod","tag-chown","tag-file-permissions","tag-linux-permissions","tag-linux-permissions-chmod-chown","tag-linux-server","tag-permission-denied","tag-vps-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Fix &quot;Permission Denied&quot; Errors on Linux: chmod and chown Explained<\/title>\n<meta name=\"description\" content=\"Fix Linux &quot;Permission Denied&quot; errors fast. Learn how to use chmod and chown to correct file and directory permissions on VPS and shared hosting servers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fix &quot;Permission Denied&quot; Errors on Linux: chmod and chown Explained\" \/>\n<meta property=\"og:description\" content=\"Fix Linux &quot;Permission Denied&quot; errors fast. Learn how to use chmod and chown to correct file and directory permissions on VPS and shared hosting servers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/\" \/>\n<meta property=\"og:site_name\" content=\"Host And Tech knowledge base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/stshostandtech\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-03T06:12:12+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@stshostandtech\" \/>\n<meta name=\"twitter:site\" content=\"@stshostandtech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/person\\\/b6fa79c48ddaba71af32e395c5b017ee\"},\"headline\":\"How to Fix &#8220;Permission Denied&#8221; Errors on Linux: chmod and chown Explained\",\"datePublished\":\"2026-06-03T06:12:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/\"},\"wordCount\":1467,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\"},\"keywords\":[\"chmod\",\"chown\",\"file permissions\",\"linux permissions\",\"Linux permissions chmod chown\",\"Linux server\",\"permission denied\",\"VPS linux\"],\"articleSection\":[\"Linux Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/\",\"name\":\"How to Fix \\\"Permission Denied\\\" Errors on Linux: chmod and chown Explained\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#website\"},\"datePublished\":\"2026-06-03T06:12:12+00:00\",\"description\":\"Fix Linux \\\"Permission Denied\\\" errors fast. Learn how to use chmod and chown to correct file and directory permissions on VPS and shared hosting servers.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/linux\\\/fix-permission-denied-error-linux-chmod-chown\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fix &#8220;Permission Denied&#8221; Errors on Linux: chmod and chown Explained\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\",\"name\":\"Host And Tech knowledge base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\",\"name\":\"Host And Tech knowledge base\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/logo-dark.png\",\"contentUrl\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/logo-dark.png\",\"width\":1134,\"height\":395,\"caption\":\"Host And Tech knowledge base\"},\"image\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/stshostandtech\",\"https:\\\/\\\/x.com\\\/stshostandtech\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/person\\\/b6fa79c48ddaba71af32e395c5b017ee\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/hostandtech.com\\\/kb\"],\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/author\\\/admin_fjj7qydm\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Fix \"Permission Denied\" Errors on Linux: chmod and chown Explained","description":"Fix Linux \"Permission Denied\" errors fast. Learn how to use chmod and chown to correct file and directory permissions on VPS and shared hosting servers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/","og_locale":"en_US","og_type":"article","og_title":"How to Fix \"Permission Denied\" Errors on Linux: chmod and chown Explained","og_description":"Fix Linux \"Permission Denied\" errors fast. Learn how to use chmod and chown to correct file and directory permissions on VPS and shared hosting servers.","og_url":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/","og_site_name":"Host And Tech knowledge base","article_publisher":"https:\/\/www.facebook.com\/stshostandtech","article_published_time":"2026-06-03T06:12:12+00:00","author":"admin","twitter_card":"summary_large_image","twitter_creator":"@stshostandtech","twitter_site":"@stshostandtech","twitter_misc":{"Written by":"admin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/#article","isPartOf":{"@id":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/"},"author":{"name":"admin","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/person\/b6fa79c48ddaba71af32e395c5b017ee"},"headline":"How to Fix &#8220;Permission Denied&#8221; Errors on Linux: chmod and chown Explained","datePublished":"2026-06-03T06:12:12+00:00","mainEntityOfPage":{"@id":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/"},"wordCount":1467,"commentCount":0,"publisher":{"@id":"https:\/\/hostandtech.com\/kb\/#organization"},"keywords":["chmod","chown","file permissions","linux permissions","Linux permissions chmod chown","Linux server","permission denied","VPS linux"],"articleSection":["Linux Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/","url":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/","name":"How to Fix \"Permission Denied\" Errors on Linux: chmod and chown Explained","isPartOf":{"@id":"https:\/\/hostandtech.com\/kb\/#website"},"datePublished":"2026-06-03T06:12:12+00:00","description":"Fix Linux \"Permission Denied\" errors fast. Learn how to use chmod and chown to correct file and directory permissions on VPS and shared hosting servers.","breadcrumb":{"@id":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hostandtech.com\/kb\/linux\/fix-permission-denied-error-linux-chmod-chown\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hostandtech.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How to Fix &#8220;Permission Denied&#8221; Errors on Linux: chmod and chown Explained"}]},{"@type":"WebSite","@id":"https:\/\/hostandtech.com\/kb\/#website","url":"https:\/\/hostandtech.com\/kb\/","name":"Host And Tech knowledge base","description":"","publisher":{"@id":"https:\/\/hostandtech.com\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hostandtech.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hostandtech.com\/kb\/#organization","name":"Host And Tech knowledge base","url":"https:\/\/hostandtech.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/05\/logo-dark.png","contentUrl":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/05\/logo-dark.png","width":1134,"height":395,"caption":"Host And Tech knowledge base"},"image":{"@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/stshostandtech","https:\/\/x.com\/stshostandtech"]},{"@type":"Person","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/person\/b6fa79c48ddaba71af32e395c5b017ee","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/hostandtech.com\/kb"],"url":"https:\/\/hostandtech.com\/kb\/author\/admin_fjj7qydm\/"}]}},"_links":{"self":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":0,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"wp:attachment":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}