Understanding how to alter permissions to files on your server is imperative in creating a functional website. There are many scripts and applications that require certain permissions in order to function properly. Being able to alter the permissions to files is now easier than ever as it can be done directly in File Manager by using cPanel.
In this blog, I will walk you through step-by-step to show you how to alter file permissions in less than one minute. Before we get there, let’s review the core basics to file permissions.
Core Basics of File Permissions
Every folder and file on your server has three owners. These are as follows:
User: You are the user!
Group: Users from your website who are able to access the file.
World: End visitors who access your site through a web browser.
Each one of the owners has its own set of permissions. The permissions are Read, Write and Execute. Below is an overview of their function:
Read: The read permission grants the ability to read a file. This is what allows for applications to read files needed to function. An example of the read permission would be how it is used for a directory. When a directory is granted read access, the application can read the names of files within it but are unable to view specifics.
Write: The write permission grants the ability to modify a file. Modification to a file includes creating, deleting and renaming.
Execute: The execute file grants the ability to execute a file. Once this permission is granted, the operating system is able to run the file.
Now that you understand the basics of file permissions, let’s learn how to to alter them through a web browser.
How To Change File Permissions
The first step will be to login to the Client Area. Once logged in, Access cPanel. After you are in cPanel, access File Manager.
Once in File Manager, locate the file in which you are looking to alter the permissions. In this example, I have created the file “testfile.html” in my website’s root directly. Left click the file.
After you left click the file, it will highlight as shown above. Now, with the file selected, click Permissions in the upper right hand corner.
When you click Permissions, the file’s permissions will be displayed on your screen. By default, a file should always have 644 permissions and a folder should always have 755 permissions. However, certain scripts and applications require special permissions to function.
In this example, we are going to grant the “User” all permissions, which will allow access to read, write and execute the file. We will then grant “Group” and “World” mode with the permissions to read and execute. This is a common permission combination known by the binary code of 755. To accomplish this, tick the boxes desired.
The last step is to save your changes. To save, click on the Change Permissions button.
Leave a Reply