In Hosting Fundamentals, Hosting Guides

File and folder permissions

Stefan Posted by

All files and folders have layers of permissions to allow the owner of those files to determine who can use the file, and how. The structure is as follows:

Read Write Execute
Owner
Group
Others

The column along the left refers to the types of user who may access the file, and the column along the top specifies what kind of permission they have with the file.

The ‘owner’ is the owner of the file; the ‘group’ refers to members of the files group and ‘others’ is everyone else.

‘Read’ permission allows you to read a file (or view the contents of a directory). ‘Write’ permission allows you to write to or edit/save information into a file or directory. ‘Execute’ permission allows you to run a file.

File and folder permissions are represented in several ways. It is common for a file to have its permissions shown in the following format:

Samplefile.txt rwx rw- r-x

So this file has ‘read’, ‘write’ and ‘execute’ permissions for the user, ‘read’ and ‘write’ for the group, and ‘read’ and ‘execute’ for others.

It is also common for this to be displayed numerically. For instance, a file may have the permissions of 644; the first number relates to the ‘owner’ permissions, the second the ‘group’, and the last number, ‘others’. Each number correlates to a specific set of permissions:

1 – execute
2 – write
3 – write and execute
4 – read
5 – read and execute
6 – read and write
7 – read, write and execute

So if a file has a permission of 644 set, the owner can read and write, while the group and others can read only.

File permissions are vital to ensure programs run correctly. If a file can only be read then it is protected from editing; similarly, some files may require editing, and so they have to be writeable to function properly.

Stefan

Author Stefan

More posts by Stefan

Talk with one of our hosting experts today


Or call 0800 033 7074