cPanel Flash Tutorial: How to change file / folders permissions?
This cPanel Flash Tutorial will show you how to change file or folder permissions using File Manager.
Permissions that are assigned to a file or folder determine the level of access a user can have to that file or folder. Below you can learn how to set file permissions for common file types and folders: web pages, Perl scripts, PHP scripts, images and folders. Incorrect permissions may be a reason for server error messages like "Forbidden" and "Internal Server Error". In File Manager, you can see and change all permissions in numeric format for files as well as folders.
Access permissions of files on UNIX (including Linux and other UNIX variants) machines tell the operating system how to deal with requests to access these files. There are 3 types of access:
- Read - Denoted by r and numeric value of 4 - user can read files and directory contents with this access.
- Write - Denoted by w and numeric value of 2 - user can change files or create / delete files in a folder.
- Execute - Denoted by x and numeric value of 1 - user can execute files or search directories.
Therefore, a number 7 for a user set indicates that the set has read, write as well as execute permission (4+2+1=7) Number 0 = No permission.
There are different types of user sets:
- User - The owner of the file. The user who creates a file automatically becomes its owner.
- Group - A set of users. All users of the group will have same set of permissions to the file.
- World - Someone who is not the owner or member of group the file belongs to. Basically everyone else.
- To change file or folder permissions in cPanel you need to log in to the control panel.
- Then click on the "File Manager " icon on the main screen.
- Click on the name of the file or folder and then on the "Change Permissions" in the top-right corner of the page.
- Click on the tick boxes or type a number in the boxes below to create the right permission.
- Click on "Change" button to set the selected permissions. The permission level has now been updated and will be displayed .
The following permissions need to be allocated for a site to function correctly.
- All HTML files as well as images should have the permission 644 which is set automatically when files are uploaded.
- Folders need to be executable by the world which means a setting of 755 (readable, writable and executable by User; readable and executable by Group and World). This gets automatically set when a folder is created.
- All CGI scripts also need to be executable by World which again means a setting of 755 (readable, writable and executable by User; readable and executable by Group and World). These permissions have to be assigned manually.
It is important not to give write permission to everyone because that could lead to file or folder deletion.
- Change current directory
- Change file / folders permissions
- Copy files
- Delete existing files / folders
- Edit file using an online HTML Editor
- Moving files
- Renaming a file or folder
- Creating a new file / folder
- Uploading files to your site
- Viewing a file's content