This article will explain in detail how you can use cPanel’s File Manager to set permission for your web site’s files and directories.
What is File Permissions?
Access permissions of files and directories on Linux computer tells the operating system about how it can handle access requests. There are three types of basic access permissions :
(i) Read: Files that have read access enabled can be only viewed by the user. The read permission is denoted by the letter ‘r’ or number 4.
(ii) Write: Files that have to write access enabled can be modified by the user. The write permission is denoted by the letter ‘w’ or number 2.
(iii) Execute: Files that have executed access enables can be run as programs by the user, and directories with execute access enabled can be accessed by the user. The execute permission is denoted by the letter ‘x’ or number 1.
Three different types of user groups are assigned to these three access permissions.
(i) User: User is the owner of a file.
(ii) Group: All the other users those belong to the same group as the group to which the file belongs.
(iii) World: This access type is for everyone else, that means, all those who are not the user or those who are not in the same group.
You can combine access permission and access types to determine the full permission settings for a file or directory. For example, a file with reading and write permission for the user has a permission value of 6.( Adding the read value of 4 and the write value of 2 equals to 6).
If the same file also has read permissions for the group and world, those have permission value 4 each. Then the file’s total permission value is represented numerically as 644.
Set File Permission to your website
Your website’s file needs to be accessed by a web server so that it can send them to a user’s web browser. Thus, your file needs correct file permission set for your website to work properly.
Refer to the below table to find out the correct permission settings for various file types on your website:
• To make all HTML files and image files readable to others (World). The correct file permission setting is 644 and it gets set automatically when you upload files to your site. Table for permission settings is :
• To make all directories executable by others (World). The right file permissions setting is 755 which gets set automatically when you create a directory on your site. Table for permission setting is :
• To make all CGI files (that means, all files in your CGI-bin directory) executable by others (World). The right file permission setting is 755, but this does not set automatically when you upload CGI files to your site. You manually need to change the file permission for CGI files. Table for permission setting is :
# How to change permission for a file or directory?
Perform the following steps to change the permission for a file or directory:
1. Login to cPanel.
2. In the cPanel home screen, go to the Files section. And then click on File Manager.
3. In the same File Manager main window, select a file or directory that you wish to change.
4. Click on the Permission button.
6. Now click on Change Permission.
You are done.
Also Read :