Learn about cPanel file manager

The Ultimate Guide To cPanel File Manager

How to set permission for your files or folders using the cPanel File manager

As a multi-user system, Linux/UNIX uses defined users and groups, ownership, and permissions to specify who has access to a file or directory.

This is a built-in security measure designed to ensure that only the person with the right privilege can access or modify a file.

cPanel is a Linux-based system.

So, you will expect the same rules to apply.

For your website directories and files in cPanel to be able to behave as expected, they must have the right permissions and ownership.

When a file has incorrect permission, the website might not load properly or the application might crash.

Files and directories in Linux have the following three permissions for all three kinds of owners:

For files:

  • Read – view or copy file contents
  • Write – modify file content
  • Execute – run the file (if it is executable)

For directories:

  • Read – list all files and copy the files from the directory
  • Write – add or delete files into a directory (needs execute permission as well)
  • Execute – enter the directory using the cd command.

You can see this with the “ls” when using the command-line interface:

ls -al

You can also use the stat command which lists important attributes of the files, and directories and also display information on the filesystem, instead of the files.

stat public_html

To set new permissions for the user, group, and world (others), select to highlight the file.

Select the Permissions option from the toolbar.

Check or uncheck read, write, and execute as needed.

This works if you are modifying a single file or folder.

What if you have migrated or moved old website files to your new cPanel hosting account and want to ensure that the file and folder permissions are right?

You can modify the directory permissions with:

find /home/$username/public_html -type d -exec chmod 755 {} \;

You can modify the modify file permissions with:

find /home/$username/public_html -type f -exec chmod 755 {} \;

Pages: 1 2 3 4 5 6 7 8 9 10 11 12


Posted

in

,

by