TechKnowSurge
CompTIA Tech+ 1.1 CompTIA A+ Core 2 1.11 CompTIA Server+ 3.3 CompTIA Server+ 3.2 CompTIA Security+ 4.1
VideoComputeFree

Octal and Unix Permissions

The octal numbering system maps directly to Linux and Unix file permissions, providing a concise numeric shorthand for controlling read, write, and execute access across users, groups, and others.

Complete this video to capture a CTF flag worth 1 point.

About this video

Linux and Unix file systems control access through a permission model that assigns read, write, and execute rights independently to three categories: the file or directory owner, an associated group, and all other users. Each permission is a single binary flag — a one indicates access is granted, a zero means it is denied — and the three flags for each category form a three-bit binary value. Because three binary digits map directly to a single octal digit, the entire nine-bit permission string for a file can be expressed as a three-digit octal number, making octal notation a natural fit for this system. In practice, each octal digit is calculated by assigning weighted values to the three permissions: read carries a value of four, write a value of two, and execute a value of one. Adding the values of whichever permissions are enabled produces the octal digit for that access level. For example, granting read, write, and execute to the owner yields seven, read and execute for the group yields five, and no access for others yields zero — resulting in the octal value 750. The chmod command applies these octal values directly on the command line, instantly updating a file or directory's permission settings. This approach gives system administrators precise, efficient control over access configuration, and understanding the relationship between binary flags and octal values is fundamental to managing security and access on any Linux or Unix-based system.

What you'll learn

What's covered

Octal & Unix Permissions

Aligned to

CompTIA Tech+
1.1 Compare and contrast notational systems.
CompTIA A+ Core 2
1.11 Identify common features and tools of the Linux client/desktop OS.
CompTIA Server+
3.3 Given a scenario, implement group policies and access controls.
3.2 Given a scenario, apply server hardening methods.
CompTIA Security+
4.1 Given a scenario, apply common security techniques to computing resources.

Key terms

File Permissions
Settings on a Unix/Linux file or directory that control read, write, and execute access for the owner, group, and all other users.
Octal Notation
A base-8 numbering system used in Unix/Linux to represent file permission settings as a three-digit value, where each digit corresponds to user, group, and other access levels.
chmod
A Unix/Linux command used to change the permission settings of a file or directory using symbolic or octal values.
Read, Write, Execute
rwx
The three permission types in Unix/Linux: read allows viewing a file, write allows modifying it, and execute allows running it as a program or traversing a directory.
Least Privilege
A security principle that grants users and systems only the minimum access rights needed to perform their functions.
Access Control
A security mechanism that restricts access to resources based on policies, roles, or identity.

Transcript

If you're using the octal numbering system, you're probably using it for some sort of Linux or Unix file permissions. That's more often than not the case where we have to use this.

Flags

So where would we really see this octal system? It has to do with permissions and the settings that we have on these permissions. There are flags. So let's first of all talk about what a flag is. A flag is a setting. It's a single bit. It's to turn something on or something off. So a lot of times we associate it with some sort of settings, that we can turn a setting on or off.

Here's just an example. Here's just some settings; let's say we have these random settings here. If I wanted to turn this 4D 3D 3d3 on, I would turn it from a zero to a one, and then that would turn that setting on. Or let's say the Hat wobble: right now the Hat wobble is on, but let's say I wanted to turn it off. So I'd turn that to a zero and then it would turn off.

User, group and everyone else

So how do those settings apply? Well, in permissions for Unix or Linux, there's a series of settings that we have, either ones or zeros. So what does that look like? First of all, we have three different levels here. First of all we've got the user. The file or folder, and this could apply to files or folders, there's going to be some sort of user that's going to be attached to that, the owner of that file or folder. There's also going to be a group that's attached to that, and then there's going to be everyone else, that's not part of this group or not part of this user. So for instance, maybe we have a website, and the file permissions on that website we want to make available to everyone else. Well, we would need to set it up that way.

Read, write and execute

So what are the different permissions that we can get for each of these groups? It's all the same for each of these groups: it's read, write and execute. Read means that you could open up a file and read it, so I'd be able to take a file and open it up and be able to read that document, or whatever the case may be. And then write means that I could actually modify that document, so I could go in there and add extra text if it's a text document. And then there's the execute, and execute is like if there's a program, being able to execute that program; or if this is a directory, being able to just read what else is inside that directory.

So for the user, maybe this is the owner, so maybe we want them to be able to read, write and execute anything that's in that folder. Perhaps at the group level here we want them to be able to read and execute that. However, maybe the rest of the world, maybe it's a website and we just want them to be able to read. So this would be the settings for each one of them. Then a one means that it's turned on and available, that the user can read, write and execute. The zero means that they can't, so the group would not be able to write.

What it looks like on an actual machine

I'm on my demo Pi here, and I just want to show you what these permissions look like on an actual machine. Linux is what the base of this is. So I'm going to open up a terminal here, and I'm going to just make this a little bit bigger, and then I'm going to list out what's in this directory. So I'm going to do an ls -l and hit enter, and let's take a look at this and see what this looks like. In fact, I'm going to even make it a little bit bigger here, just so we can see this.

So what do we have? Well, first of all, here are the permissions that we're talking about right here. If it's showing you the letter, the rwx, that means that the permission is turned on, and if it's a dash, that means it's turned off. And what we see over here, demo Pi 42, that is the user for this directory right here, which is the directory Desktop. The second demo Pi 42 is the group, so it's a user and group by the same name, and so we've got demo Pi 42.

So what is this telling us? What it's telling us is this first d means that this is a directory. So Desktop is a directory, like a folder, and Documents. In fact all of these, there's these at the beginning of all of these, so these are all folders here, all directories.

So what can the user do? Well, the user can read, write and execute; those are all turned on. What can this group do? Whoever's part of the demo Pi 42 group can read and execute. The dash here means that they can't write, that that's turned off. And then if they're not part of this group or not this user, what can they do? Well, they can read and execute. They cannot write, because we see a dash right there. So these are the permissions. This is what it actually looks like on an actual machine.

Working out the octal

So what do these settings have to do with octal? Well, if we want to make a change, one way that we can do that is by figuring out the octal equivalent of what we want to change on these different files and folders. So what does that look like? Here we have the user, group and other listed out, and for each one of these we have the read, write and execute for each one of those.

In this case right here, let's say we wanted the user to read, write and execute, so we've got a one turned on for each of those. And the group: for the group we want to read and execute for that. And everyone else we want to block from them having access or being able to execute anything. So that's the settings that we want.

Now how do we then make this change? Well, we figure out what the octal is for this, because this is what the computer sees right here. But how do we actually make this change? What we need to do is we need to figure out the octal equivalent of this. So in binary it's a one, two and a four here. So we've got the four turned on, so we've got a four, plus we've got the two turned on, plus we've got the one turned on. We add that together: four, 5, 6, 7. So that is going to be seven right there. That's the answer for that first number.

The second number here, we've got the four and the one turned off, so four are turned on, so the four plus the one is five. So we've got five right there. Then we've got nothing turned on over here, so that's just zero. So if we wanted to have these as the permissions, then we would set the setting to 750, and that would implement this change.

Changing it with chmod

So what does this look like on our actual Linux machine? Well, let's use this folder Music right here. What is the current settings right here? The current settings: read, write and execute is turned on for the user, so that would be seven, because that's 4 + 2 + 1, so 7. The read and execute is turned on for the group, so that would be four, five; 4 + 1 is five. And then same thing for the other, so that would be four. 755 is what it's set to, and we want it set to 750.

So to change that, I'm going to do the command chmod, so that's change mode, and then I'm going to type in the number that I want, which is 750, so it turns off the read and the execute for other. And then the folder that I want this applied to, which is Music. And I hit enter, and then I'm going to list out the directory again, and now we see that the read and execute is also turned off on the Music. So we have now implemented that change.

If I want to change it back, I'm just going to hit the up arrow here and change it back to 755, hit enter, and then we'll list this out again, and now what we see is it's back to where it was before. So that's how you would use the octal on setting the permissions of this machine.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →