What are permissions? There are the conditions dictating file access that allow server computers to write and edit your files, it’s also the permissions that protect some files being from being written and edited by unauthorized parties.
With cPanel you can change your file permissions in several ways. One of the easy and basic ways to change the permissions is through File Manager.
How to change the permissions for a file or folder in cPanel:
Using File Transfer Protocol
Connect to FTP and go to the file. Right click on the file and choose Permissions or Attributes or Properties.
Using SSH or a script
This can be done with the chmod command.
The script system is represented by a grid of three columns and three rows. The columns are the three types of users. First is the owner (you), the person who has access to the cPanel or shell. Second is the Group (the other people on your server). Third is the World (any visitor from the public).
Each row represents a permitted action for a file. Read means the user has permission to view the file. Write means the user has permission to the file. Execute means the user has permission to run the file.
The Group and the World should be able to view your website files. For any file you don’t what them to see you can remove the check mark in the intersecting box. If you remove the check mark for Read under Group and World, then the file will not show in anyone’s browser and they will see a 403 Forbidden error.
In File Manager, permissions are represented as numbers. A string should only have three numbers, if you see four digits, gnore the first one. So 0755 is the same as 755.
The numbers represent a combination of each unique permission. The first of the three numbers always represents the permissions for the owner, the second digit represents the group and third, the world.
Adding up the numbers/permissions, you get:
Your files should always have permissions of 644 or 755. It actually won’t matter if you give the executable permission or not as you won’t see any difference.
Folders must always be 755 and any files inside the cgi-bin folder must have 755 permissions.
You can also have files with 777 permissions. However, some hosting servers don’t normally allow this for security reasons. You might have also heard somewhere that some scripts will require you to have 777 permissions, but this is really not necessary. A 755 should do the trick.