How do file permissions work?

This FAQ will explain file permissions on your Hosting package

In a Web server environment permissions are used to control which Web site owners can access which directories and files.

This FAQ will help you understand what file permissions are and how they work.

User Types:

File permissions can be confusing. The basic permissions come in three categories of user type:

Owner Permissions: Control your own access to files

Group Permissions: Control access for anyone in your group

Other Permissions: Control access for all others

Permission Types:

When permissions are configured, the server allows you to define different permissions for each of these three categories of users.

The permissions are:

r = Read permissions - read a file or list a directory's contents

w = Write permissions - write to a file or directory

x = Execute permissions - execute a file or recurse a directory tree

How it all works:

So as shown below each user type has the possibility to read, write & execute.

OwnerGroupOther
r w xr w xr w x

 

So now for the fun part! Each permission type is allocated a number as shown below.

OwnerGroupOther
r w xr w xr w x
4 2 14 2 14 2 1

 

To give the ‘owner’ user type read, write & execute permissions you would add the 4+2+1 which equals 7.

This can then be repeated for the other two user types giving a permission code of 777

4+2+14+2+14+2+1
=777

 

This means that each user type would now have full permission on all files and directories.

Examples:

Commonly used for files on a web server.

644 = rw- r-- r--
Owner has Read, Write and Execute
Group has Read only
Other has Read only

 

Commonly used for directories on a web server.

755 = rww r-x r-x
Owner has Read, Write and Execute
Group has Read and Execute only
Other has Read and Execute only

 

Please note: In the file manager, if a file/folder is highlighted in red/pink it means that the file/folder is not using the recommended permissions.