-->
What are the File Permissions and their Types in cPanel? / How do I Set File Permissions in cPanel?

What are the File Permissions and their Types in cPanel? / How do I Set File Permissions in cPanel?

Back to top

Updated by Ashirafu Kibalama on April 19, 2024

Understanding File Permissions in cPanel: Types and How to Set Them






File permissions are crucial for website management and hosting. This blog post will explore file permissions within cPanel, covering different types and their significance. 


We will also provide a step-by-step guide on efficiently setting file permissions using cPanel's intuitive interface. By the end of this post, you will have a comprehensive understanding of file permissions in cPanel, empowering you to manage your website's security and access control effectively.



What are the File Permissions in cPanel?


                                                          


In cPanel, file permissions refer to the settings that control access to files and directories on a web hosting server. These permissions dictate who can read, write, and execute files or directories. In cPanel, file permissions are typically represented as a series of three numbers or a combination of letters and symbols.




What are the Types of File Permissions? Explain.




The types of file permissions are categorized into three types (read, write, and execute) for three distinct categories of users (owner, group, and others). These permissions control who can perform specific actions on a file or directory. Here's a detailed explanation of the three types of file permission:


3 Types of File Permissions


1) Read (r):




    • For files: Allows users to view the contents of the file.
    • For directories: Allows users to list the contents of the directory.


2) Write (w):



    • For files, it allows users to modify the file's contents, including creating, deleting, or modifying the file.
    • For directories: Allows users to add, remove, or rename files within the directory.


3) Execute (x):




    • For files: Allows users to execute the file if it is a script or a program.
    • For directories, this allows users to access the directory and its contents. Without execute permission, users cannot access files or subdirectories within the directory, even if they have read or write permissions on those files.


These permissions are assigned to three different categories of users:




1) Owner: The user who owns the file or directory.



                                       


2) Group: A group of users to which the file or directory belongs. Users who belong to this group inherit its permissions.



                                 



3) Others: Any other user who is not the owner and does not belong to the group.


                             


File permissions are typically represented by three characters for each user category: owner, group, and others. These characters can be combined to define the permissions for each category.


For example, if you see a file permission set like rw-r--r--, it means:


The file has owner read-write permissions, group read-only permissions, well, and other read-only permissions.


File permissions may be represented numerically in octal notation, assigning each permission a numeric value:

  • Read (r) = 4
  • Write (w) = 2
  • Execute (x) = 1


The sum of these values represents the permission set. For example:

  • rwx (read, write, execute) = 4 + 2 + 1 = 7
  • rw- (read, write) = 4 + 2 = 6
  • r-- (read-only) = 4


Using this notation, the standard permission set for a file: rw-r--r-- can be represented as 644.




The standard permission set for a directory: rwx-rx--rx-- can be 755.





How do I Set File Permissions in cPanel?


In cPanel, you can set file permissions using the "File Manager" tool. Here's a step-by-step guide on how to set file permissions in cPanel:


7 Steps To Set File Permissions in cPanel


Step 1) Log in to cPanel




Open your web browser, navigate to your cPanel login page and log in.


Step 2) Locate the File Manager




Once logged in, find and click on the "File Manager" icon.     



It is usually located in the "Files" section of cPanel.


Step 3) Select the file or directory



#directory in this case:  



Navigate to the file or directory you want to change the permissions. You can do this by clicking through the folders displayed in the File Manager.




Step 4) Right-click the file or directory


#templates directory





Once you've found the file or directory, right-click on it to open the context menu.


Step 5) Modify "the Permissions"






Then modify the file permissions.


You'll see checkboxes for setting the read, write, and execute for the file owner, group, and others, respectively. 


Check or uncheck the boxes as needed to set the desired permissions.


For example:





Step 6) Apply the changes


                                                 


After setting the permissions, click the "Change Permissions" button to apply the changes.


Step 7) Verify changes

Go to the file or directory where the changes are applied and check to see if they have been applied. 


#templates directory before changing permissions.





#templates directory after changing permissions.




You can also verify the new permissions by checking the permissions displayed to the file or directory in the File Manager where the changes are applied.





#changes already applied:





It's essential to be cautious when changing file permissions, as setting them incorrectly can compromise your website's security or functionality. Make sure to set permissions appropriately based on your specific needs and requirements.


Conclusion:

File permissions are critical for your website's security and integrity. We explored different types of file permissions in cPanel, and our step-by-step guide provides a practical resource for quickly navigating the process. 


By prioritizing proper configuration, you can safeguard against security threats and ensure optimal performance. 


Understanding file permissions is essential for maintaining a secure online presence; with this knowledge, you can confidently take control of your website's security.


Kindly examine the post and share your suggestions to help us improve. Your feedback is valuable and much appreciated.


I hope you're doing well and finding my assistance helpful. If you need additional help, please don't hesitate to let me know.


Thank you, and Happy coding!


Related Posts:

How To Access Your cPanel Website With an IP Address?/ What is the IP Address of Your cPanel Server? 

How To Check/ See Traffic to Your Website in cPanel?

How To Get cPanel Login Details/ How To Find cPanel Username and Password

How Safe is cPanel? / Best Security Practices To Make Your Website cPanel Secure 

What To Look For While Selecting Any Web Hosting Company 

What is Better Than cPanel?

When To Use cPanel? 

Is cPanel Good for Hosting? 

Why do People use cPanel? 

10 What are the Disadvantages of cPanel Hosting? 

11 How To Fix: Your Session Cookie is Invalid. Please Log in Again./ Why is cPanel Login Invalid?

12 Why is there no terminal in cPanel?/ Enable Terminal in Cpanel on Shared Hosting like Namecheap