cPanel File Permission 777 to 644 – Avoid Security Risk

Posted on

Permission used to specify which particular person may or may not have access to file or directory. There are lot of good security features built into Linux, UNIX in order to protect high confidential data from third party.

Don’t allow other people to change your files and you also want system files to be safe from damage. This article is helpful to you to know how to change file or directory permission cPanel.

777 Permission: Everyone can read write and execute the files. Is it really good to set 777 permission to all folders and files? No.

Why 777 permission is not good for files and folder?

  • Third party can do modifications into your files.
  • Anyone can add malicious code to your server.
  • Without owner permission, anyone can do modifications to your files.

In this article I’m explaining you how to change file permission in cPanel. So you can easily change the cpanel default file permission and secure your files from third party.

Solution: Set 644 permission to files and folders

 644 Permission: In this case, owner can only read and write to the files and group and others can only read the files. It is always recommend that use 644 permission to files and folders.

There might be question that how to set cPanel file permissions. Because there might be some people who don’t know how to change cPanel file permissions. In this article I’m going to tell you how to set the folder permission.

Before that, You need to focus on one thing. By default some files in our cPanel are hidden and if you want set permission to those hidden files, you need to access them first.

But some of people might be unaware about how to change user permission in cPanel, so from here you can learn how you can access the hidden files and set permission to them.

Follow the following steps to set 644 permission to files and folders in cPanel.

1] Login to your cPanel account and click on the File Manager.

change all file permissions cpanel

2] Select any file that you want to set 644 permission. In this example, I’m selecting file with 777 permission.

edit password file permission denied cpanel

3] Right click on the file and select Change Permission.

cpanel change file permission recursively

4] As I have selected file with 777 permission it is showing here 777 permissions.

cpanel file manager change permissions

5] Set read and write mode in owner section and keep group and others section in read only mode.

change default file permissions cpanel

6] Click on Change Permissions.

In this way, you can fix file permissions in cPanel. As per your requirement, you can set cpanel permissions for public_html or any other files/folder.

In our WHMCS Tutorial guide, I have explained you in detail how to change the file permission. From here you can see.

[Additional Information]

Understand on what basis you can set the file permission:

UNIX, Linux provide way to change file permission in cPanel. It has file control mechanism to determine who can access a particular file or directory and what actions they can do to it.

  • Classes: It determines who can access the file.

1] Owner: Creator of the files/folders.

2] Group: Group of users who share the same permissions.

3] Other: Peoples who is not in group or in owner.

  • Permissions: Determines the kind of action the user can do to the file. It determine by single letter.

1] r read – you may view the contents of the file.

2] w write – you may change the contents of the file.

3] x execute – you may execute or run the file.

On what basis numbers are set to each permission?

Read is equivalent to ‘4’.

Write is equivalent to ‘2’.

Execute is equivalent to ‘1’.

Now you might be having question, Why to use 3 digits like 777 or 644. First digit for owner, second for group and third for others.

Hope you understand how to set folder/file permission in cPanel from 777 to 644. This will definitely help you to secure your server and prevent third party to access folder.

You can also read our most important article about how to avoid email spamming.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

twenty − seven =