How to Change File Permissions in cPanel
The File Manager in cPanel allows you to do much more than upload files to the server. This tutorial will show you just how easy it is to change permissions on the files you have uploaded.
Changing File and Folder Permissions
- Open the File Manager in cPanel and then find the file or folder you want to change permissions on.
- Click on the name of the desired file or folder
- Next, click the Change Permission link, which should be in the top-right corner of the File Manager window.
- Follow the prompts required to create the appropriate permission. The permission numbers under the tick boxes should automatically update.
- Lastly, click the “Change” button once you have finished setting the permission. After you do this, the new permission level will be saved and display the update to show that the file has been modified.
What You Should Know About Unix-like Files and Permissions
Each file on a Unix, Linux, other Unix-like server has certain access permissions. These permissions are critical as they instruct the operating system on how to handle requests made to access those files. When it comes to these operating platforms, files have three types of access:
Read - Represented by an “R”, read access allows files to be displayed to the user.
Write - Represented by a “W”, write access allows files to be modified by the user.
Execute – Represented by an “X”, execute access allows files to be executed as programs by the users.
Access to these files is classified in three types of groups:
User – The user who owns the file.
Group – Related files that are in the same group or folder
World – Everyone Else
Permissions Settings
In order to for your pages to be displayed in your visitors’ browsers, the web server must first be able to read them. Therefore, the following permissions must be set in order for your site to function properly:
- All of your images and HTML files must be readable by others. The setting to make this possible is 644, which makes these elements readable by the User, Group and World, but just writable by the user. 644 should be automatically set once you upload files to the server.
- All of your folders must be executable by others. The setting to make this possible is 755, which makes these elements readable by the User, Group and World, writable by the User, and executable by the User, Group and World. This is automatically set when you create a folder.
- All of your CGI files in the CGI-bin must be executable by others. The setting to make this possible is 755, which makes these elements readable by the User, Group and World, writable by the User, and executable by the User, Group and World. Unlike the settings above, this one is not automatically set when you upload files. These file settings must be changed manually.
When dealing with these settings, it is critical that none of your files or folders are made writable by anyone else. If they are, any file or folder others have write access to can be deleted or compromised in other malicious ways. Because of this, you need to be very cautious of how you set permissions.
Related tutorials and articles
Leave a Reply
