{"id":61,"date":"2026-09-30T05:03:39","date_gmt":"2026-09-30T05:03:39","guid":{"rendered":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/"},"modified":"2026-09-30T05:03:39","modified_gmt":"2026-09-30T05:03:39","slug":"linux-file-permissions-chmod-chown-safer-websites","status":"publish","type":"post","link":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/","title":{"rendered":"Linux File Permissions Explained: chmod, chown, and Safer Websites"},"content":{"rendered":"<p>Linux file permissions control who can read, modify, or run files on a server. They are a basic security boundary for websites, configuration files, application code, and uploaded content. Incorrect settings can cause access errors, but overly broad permissions can also give an attacker or compromised process more control than it needs.<\/p>\n<h2>Understand owner, group, and others<\/h2>\n<p>Every Linux file and directory has an owner and a group. Permission rules are evaluated for three classes: the owning user, members of the assigned group, and everyone else. The familiar output from <code>ls -l<\/code> displays these rules as three sets of read, write, and execute flags.<\/p>\n<p>For a regular file, read allows viewing its contents, write allows changing it, and execute allows running it as a program or script. For a directory, the meaning changes slightly: read lists names, write permits entries to be created or removed, and execute allows access through the directory.<\/p>\n<p>If you are new to server administration, our overview of <a href=\"https:\/\/www.tempohosting.co.uk\/blog\/essential-linux-commands-every-website-owner-should-know\/\" target=\"_blank\" rel=\"noopener\">essential Linux commands for website owners<\/a> provides useful context for inspecting files, logs, processes, and disk usage.<\/p>\n<h2>Use chmod to change access<\/h2>\n<p>The <code>chmod<\/code> command changes permission bits. Symbolic notation can add or remove one permission, such as <code>chmod u+x script.sh<\/code>. Numeric notation combines read (4), write (2), and execute (1) for each class. For example, <code>chmod 644 file<\/code> gives the owner read and write access while allowing the group and others to read it.<\/p>\n<p>Directories commonly need execute permission so the web server can reach files inside them. This is one reason copying a file&#8217;s numeric mode directly to a directory can create confusing failures.<\/p>\n<h2>Use chown for ownership<\/h2>\n<p>The <code>chown<\/code> command changes the owner, the group, or both. Ownership should reflect which account deploys the application and which process serves it. Before running a recursive command, confirm the target path and expected result. A command applied to the wrong directory can break the operating system or expose sensitive data.<\/p>\n<p>A hosting platform may manage ownership and permissions automatically, while a VPS leaves more responsibility with the administrator. Our guide to <a href=\"https:\/\/www.tempohosting.co.uk\/blog\/how-to-choose-the-right-web-hosting-plan\/\" target=\"_blank\" rel=\"noopener\">choosing a web hosting plan<\/a> explains the trade-off between convenience, control, and management effort.<\/p>\n<h2>Avoid the 777 shortcut<\/h2>\n<p>Setting permissions to 777 grants read, write, and execute access to everyone. It may appear to fix an upload or cache problem, but it removes an important layer of protection. Find the real cause instead: the wrong owner, an incorrect group, a missing directory permission, or a service running under an unexpected account.<\/p>\n<h2>Apply least privilege<\/h2>\n<p>Give each user and process only the access required for its role. Keep configuration files containing credentials away from public write access, make application code read-only where practical, and grant write access only to directories that genuinely need it. After deployments, verify permissions with <code>find<\/code>, <code>stat<\/code>, or <code>ls -l<\/code> rather than assuming they remained unchanged.<\/p>\n<p>Test changes on a limited path first, avoid unnecessary recursive operations, and keep a record of the intended owner and mode for important directories. For an official walkthrough of symbolic and numeric notation, see Ubuntu&#8217;s <a href=\"https:\/\/ubuntu.com\/server\/docs\/tutorial\/welcome-to-the-terminal\/\" target=\"_blank\" rel=\"noopener\">terminal guide section on changing file permissions<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how Linux file permissions, chmod, and chown control access to website files and how least privilege helps keep a server secure.<\/p>\n","protected":false},"author":2,"featured_media":60,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[26],"tags":[44,45,31,43,16],"class_list":["post-61","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-chmod","tag-chown","tag-linux-commands","tag-linux-file-permissions","tag-website-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Linux File Permissions Explained: chmod, chown, and Safer Websites - Tempo Hosting Blog<\/title>\n<meta name=\"description\" content=\"Learn how Linux file permissions, chmod, and chown control access to website files and how least privilege helps keep a server secure.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux File Permissions Explained: chmod, chown, and Safer Websites - Tempo Hosting Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how Linux file permissions, chmod, and chown control access to website files and how least privilege helps keep a server secure.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/\" \/>\n<meta property=\"og:site_name\" content=\"Tempo Hosting Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-30T05:03:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.tempohosting.co.uk\/blog\/wp-content\/uploads\/2026\/09\/linux-file-permissions.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Arthur Edward\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arthur Edward\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/\"},\"author\":{\"name\":\"Arthur Edward\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/0c5cdd8616ac5c6b1d288da7ec3dd903\"},\"headline\":\"Linux File Permissions Explained: chmod, chown, and Safer Websites\",\"datePublished\":\"2026-09-30T05:03:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/\"},\"wordCount\":505,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/linux-file-permissions.webp\",\"keywords\":[\"chmod\",\"chown\",\"Linux commands\",\"Linux file permissions\",\"website security\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/\",\"url\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/\",\"name\":\"Linux File Permissions Explained: chmod, chown, and Safer Websites - Tempo Hosting Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/linux-file-permissions.webp\",\"datePublished\":\"2026-09-30T05:03:39+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/0c5cdd8616ac5c6b1d288da7ec3dd903\"},\"description\":\"Learn how Linux file permissions, chmod, and chown control access to website files and how least privilege helps keep a server secure.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/linux-file-permissions.webp\",\"contentUrl\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/linux-file-permissions.webp\",\"width\":1200,\"height\":675,\"caption\":\"Linux file permissions\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/linux-file-permissions-chmod-chown-safer-websites\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux File Permissions Explained: chmod, chown, and Safer Websites\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/\",\"name\":\"Tempo Hosting Blog\",\"description\":\"Practical guides to web hosting, websites, domains and online success.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/#\\\/schema\\\/person\\\/0c5cdd8616ac5c6b1d288da7ec3dd903\",\"name\":\"Arthur Edward\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g\",\"caption\":\"Arthur Edward\"},\"url\":\"https:\\\/\\\/www.tempohosting.co.uk\\\/blog\\\/author\\\/arthur-edward\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux File Permissions Explained: chmod, chown, and Safer Websites - Tempo Hosting Blog","description":"Learn how Linux file permissions, chmod, and chown control access to website files and how least privilege helps keep a server secure.","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:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/","og_locale":"en_US","og_type":"article","og_title":"Linux File Permissions Explained: chmod, chown, and Safer Websites - Tempo Hosting Blog","og_description":"Learn how Linux file permissions, chmod, and chown control access to website files and how least privilege helps keep a server secure.","og_url":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/","og_site_name":"Tempo Hosting Blog","article_published_time":"2026-09-30T05:03:39+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.tempohosting.co.uk\/blog\/wp-content\/uploads\/2026\/09\/linux-file-permissions.webp","type":"image\/webp"}],"author":"Arthur Edward","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Arthur Edward","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/#article","isPartOf":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/"},"author":{"name":"Arthur Edward","@id":"https:\/\/www.tempohosting.co.uk\/blog\/#\/schema\/person\/0c5cdd8616ac5c6b1d288da7ec3dd903"},"headline":"Linux File Permissions Explained: chmod, chown, and Safer Websites","datePublished":"2026-09-30T05:03:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/"},"wordCount":505,"commentCount":0,"image":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/#primaryimage"},"thumbnailUrl":"https:\/\/www.tempohosting.co.uk\/blog\/wp-content\/uploads\/2026\/09\/linux-file-permissions.webp","keywords":["chmod","chown","Linux commands","Linux file permissions","website security"],"articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/","url":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/","name":"Linux File Permissions Explained: chmod, chown, and Safer Websites - Tempo Hosting Blog","isPartOf":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/#primaryimage"},"image":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/#primaryimage"},"thumbnailUrl":"https:\/\/www.tempohosting.co.uk\/blog\/wp-content\/uploads\/2026\/09\/linux-file-permissions.webp","datePublished":"2026-09-30T05:03:39+00:00","author":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/#\/schema\/person\/0c5cdd8616ac5c6b1d288da7ec3dd903"},"description":"Learn how Linux file permissions, chmod, and chown control access to website files and how least privilege helps keep a server secure.","breadcrumb":{"@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/#primaryimage","url":"https:\/\/www.tempohosting.co.uk\/blog\/wp-content\/uploads\/2026\/09\/linux-file-permissions.webp","contentUrl":"https:\/\/www.tempohosting.co.uk\/blog\/wp-content\/uploads\/2026\/09\/linux-file-permissions.webp","width":1200,"height":675,"caption":"Linux file permissions"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tempohosting.co.uk\/blog\/linux-file-permissions-chmod-chown-safer-websites\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tempohosting.co.uk\/blog\/"},{"@type":"ListItem","position":2,"name":"Linux File Permissions Explained: chmod, chown, and Safer Websites"}]},{"@type":"WebSite","@id":"https:\/\/www.tempohosting.co.uk\/blog\/#website","url":"https:\/\/www.tempohosting.co.uk\/blog\/","name":"Tempo Hosting Blog","description":"Practical guides to web hosting, websites, domains and online success.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tempohosting.co.uk\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.tempohosting.co.uk\/blog\/#\/schema\/person\/0c5cdd8616ac5c6b1d288da7ec3dd903","name":"Arthur Edward","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d305c187f77f40bd7f15259964168e8350a52598793dbb6c5ee98b63e767dada?s=96&d=mm&r=g","caption":"Arthur Edward"},"url":"https:\/\/www.tempohosting.co.uk\/blog\/author\/arthur-edward\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":0,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/media\/60"}],"wp:attachment":[{"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tempohosting.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}