{"id":252,"date":"2026-11-27T09:00:00","date_gmt":"2026-11-27T14:00:00","guid":{"rendered":"https:\/\/quentinpidcock.com\/content\/?p=252"},"modified":"2026-11-27T09:00:00","modified_gmt":"2026-11-27T14:00:00","slug":"linux-file-permissions-explained-without-the-headache","status":"publish","type":"post","link":"https:\/\/quentinpidcock.com\/content\/linux-file-permissions-explained-without-the-headache\/","title":{"rendered":"Linux File Permissions, Explained Without the Headache"},"content":{"rendered":"<p>Everybody who starts working with Linux hits the same wall early: a file refuses to open, a script refuses to run, or a web page throws a permission error, and the answer is a string of letters like rwxr-xr&#8211; that looks like a code from a spy movie. It is not complicated once somebody explains it in plain words, so here it is the way I wish somebody had explained it to me.<\/p>\n<h2>Three Questions, Three Audiences<\/h2>\n<p>Every file and folder on a Linux system answers three questions. Can it be read \u2014 opened and looked at? Can it be written \u2014 changed, saved, or deleted? And can it be executed \u2014 run as a program, or in the case of a folder, entered and looked inside?<\/p>\n<p>Those three questions get asked separately for three audiences. First, the owner: the one user account the file belongs to. Second, the group: a named set of users who share some access. Third, everyone else: literally any other account on the machine. So a file&#8217;s permissions are nine answers \u2014 read, write, execute, for owner, group, and everyone else \u2014 and that string of letters is just those nine answers written in order. When you see rwxr-xr&#8211;, you are looking at an owner who can do everything, a group that can read and run but not change, and everyone else who can only read.<\/p>\n<h2>Why It Is Built This Way<\/h2>\n<p>This system exists because Linux was designed from the start for many users sharing one machine, where your files had to be protected from other people&#8217;s accidents and curiosity. That design turned out to be just as valuable on a server with only one human user, because the machine itself runs as many different accounts. Your web server runs as one account, your database as another, and permissions are what keep a flaw in one program from becoming a flaw in everything. A website that gets hacked is bad. A website that gets hacked and can also read every other site&#8217;s files, because permissions were left wide open, is a catastrophe. Permissions are the walls between rooms in the same house.<\/p>\n<h2>The Mistake Everybody Makes<\/h2>\n<p>The most common beginner move \u2014 I made it myself \u2014 is fixing a permission error by opening the file up to everybody completely. It works, in the sense that the error goes away. It also works in the sense that leaving your front door off its hinges fixes a lost key. On a shared or internet-facing machine, that habit quietly removes the walls that limit damage when something goes wrong.<\/p>\n<p>The better habit is asking two questions before changing anything: who actually needs access to this, and what is the least access that lets them do the job? A file a web server only needs to read should be readable and nothing more. A script only you run should belong to you and answer to nobody else. Nine times out of ten the correct fix is narrower than the error makes you want to make it.<\/p>\n<h2>Where I Land<\/h2>\n<p>Permissions are not bureaucracy the system puts in your way. They are the simplest, oldest security tool Linux has, and they are working on every file on every server I run, all day, whether I think about them or not. Learn to read the nine letters and you understand who can touch what on the whole machine at a glance. That is a lot of understanding for nine characters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Everybody who starts working with Linux hits the same wall early: a file refuses to open, a script refuses to run, or a web page throws a permission error, and the answer is a string of letters like rwxr-xr&#8211; that looks like a code from a spy movie. It is not complicated once somebody explains [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-252","post","type-post","status-publish","format-standard","hentry","category-technical-commentary"],"_links":{"self":[{"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/posts\/252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/comments?post=252"}],"version-history":[{"count":1,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/posts\/252\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/posts\/252\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/media?parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/categories?post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quentinpidcock.com\/content\/wp-json\/wp\/v2\/tags?post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}