How to Change File Permissions in cPanel
The content and files of your website inside the host must be protected because otherwise, conditions will be provided for unauthorized access to files and hacker attacks. This is where permissions become essential, and changing file access can significantly increase your website’s security.
cPanel is one of the most powerful website management control panels, I. It helps you to prevent potential weaknesses and prevent the performance and security of your website by determining sufficient access for each user and group.
Although changing file access is one of the most important measures to increase website security, the security and stability of the server itself also play an essential role in the performance of your website. If you want to take a big step in this field, go to the purchase page. Visit the virtual server and choose the best option from our beautiful plans.
Stay with us to provide you with all the necessary information about permissions and how to change file access in cPanel:
Table of Contents
- What is the access level?
- Types of file access levels in cPanel
- Important points before changing file access in cPanel
- Steps to change the key of files and directories in cPanel
What is the Access Level?
As its name suggests, permission or access level refers to the level of access of users, administrators, and visitors to the files and folders inside the host, each of which is piece of your website. Each of these sections needs protection and security, if you do not act correctly in determining access to them, sensitive files will be available to the wrong users or groups, and these files will become your website’s security weaknesses.
Each of these files has a different degree of importance, and if you include the same level of access for all of them, hazardous issues will occur for your site. For example, your site’s index.php file, which is accessible to all users, needs less security and protection compared to the config.php file, which contains the password of your website’s database, and if the file access changes, for both of these, Include the 755 permission, that is, make your database password available to all users you give consent to any user, be it an admin, a regular user, or a hacker, to read your website data or to change This is where you create a dangerous security breach for your site’s database with your own hands.
So we understand how important the role of permissions is in the website world. If you are using a Linux system and are curious to learn more about file access levels in Linux, the file access permissions tutorial article in Linux can provide you with the desired information.
Types of file access levels in cPanel
The access level of files and directories in the host is set to perform three different types of operations:
Read: This permission allows users only to read the desired file and not be able to change or delete it. This license is usually included for documentation and manuals.
Write: This permission allows users to modify the file and add or delete data if desired. Write permission is usually given to files that should be modifiable by intended users.
Execute: Execute permission allows users to run files such as programs or system scripts.
Now that we are familiar with the types of operations. It’s time to use all kinds of numeric or letter permissions that are needed when changing access to files in cPanel.
These operations are identified in the licenses with the symbols (w (Write), r (Read), and (x) (Execute). If we want to use a numerical permit, each of these operations will be displayed with the numbers 4, 2, and 1, respectively. are given.
These access levels are assigned to 3 types of users, so symbolic permissions have six characters, and numeric permissions have three numeric characters.
Before calculating these permissions, it is better to get to know these three types of users:
User: This user is the file owner because he created it and set its permissions.
Group: A group defined by administrators to perform the desired operation.
Other: All other users, such as visitors, who interact with the site.
Important points before changing file access in cPanel
– All HTML and image files on the website must be readable by all users, for which the default and correct permission is 644.
– The directories inside the host must be executable by all users so they don’t have problems accessing and using the site’s files and contents. The default and correct permission for website directories is 755.
– Important files containing sensitive information, such as database login, must have access level 400.
– All CGI files (meaning the duplicate files in the CGI-bin directory) must be executable by all users because these files are used to run web server scripts. The correct permission for these files is 755, but when uploading them to the site, this permission is not set automatically, and you have to do it manually.
– Try not to assign the 777 access level to any files and directories because, in this case, all users can change and manipulate the desired file.
– Change access so that you don’t have security problems later due to unauthorized access.
3. To change the access level of your files, first open the public_html directory.
5. Set the access level of the file or directory as you wish.
As you can see, the access of all three types of users is set separately, and you need to do the necessary checks and, if you want, include the desired access for the desired user and mark it.
The numerical permission displayed in the lower part is the sum of the permissions you mark in the upper part.
Read = 4, Write = 2, Execute = 1
If you want to change the access of several files or directories simultaneously and include the same permission for them, you can mark them and do your work by right-clicking and selecting the change permissions option.
After checking the necessary permissions, click Change Permissin to apply the changes.
Of course, you can change file permissions in cPanel in two other ways.
One is to select the desired file and then click on the permissions icon in the upper right part.
You will see the same permission change window; check the desired permissions for each user (User, Group, and World means all users), and click Change Permission.
The second is to click on the desired file’s permission, enter the numerical license in the same box, and click Save.
In general, many methods can help you change the access of files in cPanel; the important thing is to set the permissions of each file and directory correctly and not do anything that affects your performance and security. be exposed to danger.
Conclusion
The files and directories located in your host have a special access level that you can change their permissions using cPanel facilities if needed. To change the access of files in cPanel, you must act smartly and do not allow your sensitive files to be accessible to unauthorized users such as hackers and disrupt your site.
Thank you for staying with us until the end of the article. We hope that reading this article was useful for you. If you have any questions, requests and need guidance, you can contact us by registering your opinion so that we can answer you as soon as possible.