How to Change File Permissions
On a UNIX web server, every single file and folder stored on the hard drive has a set of permissions associated with it, which says who is allowed to do what with the file. Every file (and folder) also has an “owner” and a “group” associated with it. If you created the file, then you are usually the owner of that file, and your group, or the group associated with the folder you created the file in, will usually be associated with that file.
There are three types of people that can do stuff to files – the Owner of the file, anyone in the Group that the file belongs to, and Others (everyone else). In UNIX, these 3 types of people are referred to using the letters U (for Owner, or User in UNIX-speak!), G (for Group), and O (for Others).
There are three basic things that can be done to files or folders:
- You can read the file. For folders, this means listing the contents of the folder.
- You can write to (change) the file. For folders, this means creating and deleting files in the folder.
- You can execute (run) the file, if it’s a program or script. For folders, this means accessing files in the folder.
Understanding this stuff is really based but the confusion often occurs when you have to start actually setting permissions on your file server. When you use FTP or SSH, you’ll see lots of funny letters next to the files (such as rwxrw-rw-). Here’s the visual breakdown.
When you FTP to your web server, you’ll probably see something like this next to every file and folder:

This string of letters, drwxr-xr-x, represents the permissions that are set for this folder. (Note that these are often called attributes by FTP programs.) Let’s explain what each of these letters means:
As you can see, the string of letters breaks down into 3 sections of 3 letters each, representing each of the types of users (the owner, members of the group, and everyone else). There is also a “d” attribute on the left, which tells us if this is a file or a directory (folder).
Now…these letters are translated into a string of numbers. To look at which number represent the file’s permissions, right click on any file or directory to view properties/get info.


Each of the three numbers corresponds to each of the three sections of letters we referred to earlier. In other words, the first number determines the owner permissions, the second number determines the group permissions, and the third number determines the other permissions.
Each number can have one of eight values ranging from 0 to 7. Each value corresponds to a certain setting of the read, write and execute permissions, as explained in this table:
| Number | Read (r) | Write (w) | Execute (x) |
| 0 | No | No | No |
| 1 | No | No | Yes |
| 2 | No | Yes | No |
| 3 | No | Yes | Yes |
| 4 | Yes | No | No |
| 5 | Yes | No | Yes |
| 6 | Yes | Yes | No |
| 7 | Yes | Yes | Yes |
Anyways, in this window is where you can apply a new set of permissions. It’s really simple. Just change the Octal Mode Representation to number of your choice…or just click on the radio buttons when you want something to be on.
