One of the key security aspects on your server is file permissions. You have precise control over who can read, write, and execute files thanks to them. Without them, it would be difficult to securely host the websites and data of various users. 

But wrong permissions can result in problems that are challenging to diagnose. There’s a significant possibility that improperly configured permissions are to blame if a website or piece of software fails to load properly. Managing them with chmod, the default Linux permission control tool, can also be difficult.  

In this article, we explain to you how to configure file permissions in file manager after you have purchased a shared hosting for your website. So, if you want to know more, dive in.  

How do file permissions work? 

On a Linux computer, access permissions for files and directories specify how the operating system should respond to access requests. The following three categories of access permissions exist: 

  1. Read: Only the user can see files that have read access. The letter “r” or number 4 denotes read permission. 
  2. Write: Users have the ability to edit files that need write access. The letter “w” or the number 2 denotes write authorization.
  3. Execution: Users have access to executable-allowed directories as well as the ability to run executable-allowed files as programmes. The letter “x” or the number 1 designates an execution authorisation. 

These three access permissions are given to three different kinds of user groups. 

  1. User: A user is the file’s owner. 
  2. Group: Every other user in that group (the group to whom the file belongs) is included here.
  3. World: This access level is for everyone else, or anyone who is not the user nor a member of the same group as them. 

To discover the complete permission settings for a file or directory, you can combine access permission and access kinds. For instance, a file having the user’s reading and writing permission has a permission value of 6. (The sum of the read value of four and the write value of two is six.) 

If the same file also has group and world read permissions, each has a permission value of 4. Then the total file permission value is represented numerically as 644. 

Set file permissions on your website 

Files on your website must be accessible by the web server in order to deliver them to the user’s web browser. Therefore, your files need properly set file permissions for your website to work properly. 

Use the table below to find the correct permission settings for the various file types on your website: To enable others to read all HTML and image files (World). When you upload files to your website, the proper file permission setting, which is 644, is automatically configured. The following table lists the permissions: 

Parameter  User  Group  World 
Read  Set  Set  Set 
Write  Set     
Execute       
Permission  6  4  4 

 

To enable others to execute any directory (World). When you create a directory on your website, the appropriate file permissions level, which is 755 is immediately applied. The table for setting permissions is: 

Parameter  User  Group  World 
Read  Set  Set  Set 
Write  Set     
Execute  Set  Set  Set 
Permission  7  5  5 

 

To enable all CGI files (all files in your CGI-bin directory) for external execution (World). If you upload CGI files to your website, the appropriate file permission setting is 755, however this does not happen automatically. For CGI files, the file permissions must be manually changed. Table for configuring permissions is:  

Parameter  User  Group  World 
Read  Set  Set  Set 
Write  Set     
Execute  Set  Set  Set 
Permission  7  5  5 

How can I update a file or directory’s permissions? 

To modify a file or directory’s permissions, take the following actions: 

  1. Access cPanel.
  2. Go to the Files area on the cPanel home page. then select File Manager.
  3. Choose the file or directory you want to change in the same File Management window.
  4. Click the button labelled Permission.
  5. Choose the appropriate permissions by checking the appropriate boxes.
  6. Choose Change Permission from the menu.

All set! You’re done now. 

Conclusion 

With this, we hope that you have understood how to configure file permissions in file manager. In case you have any doubts, or questions, we request you to please share them with us in the comments section below. Till then, keep reading our blog posts for more interesting content. 

Author

Write A Comment