Every file on your account has a setting that controls who can read, write, and execute the file. For the average user, these will never need to be changed. When a file is created, it will already have its default permissions. However for a more advanced user there may be times that the permissions need changing.
What are File Permissions?
There are three types of permissions:
You can view your file permissions in your cPanel File Manager or FTP Client. They will display not with the letters, but with numbers. The numbers used are:
- 7 = read, write, execute
- 6 = read, write
- 5 = read, execute
- 4 = read only
- 3 = write, execute
- 2 = write only
- 1 = execute only
- 0 = Access Denied
The File Permissions will show as three numbers. The numbers always go in the same order:
For an example on how this works, let's use this account:
As you can see on the right, the permissions for each file is listed. The primary thing to remember is that certain file types use different permissions:
- public_html - 750
- Folders - 755
- CGI and Perl scripts - 755
- .html .php and other Document Types - 644
What if my permissions are wrong?
If your permissions aren't set up correctly, it can allow unauthorized users access to hack your website. Also, once your site's hacked they can change your permissions to make your site even more vulnerable. If you see any files with permissions set at 777, this means that "world" has full access. Rarely will you have a file that needs to be written to and executed by the "world." If any of your file permissions do not match the default permissions, they may need changing. Also, one of the most common needs to update permissions is to make scripts in the cgi-bin 755.
How do I change my settings?
Most FTP clients will allow you to change the permissions. You can also change them in your cPanel File Manager. First, navigate to the location of the file you want to change. We will use the same account in the picture above.
Right click on the file and choose Change Permissions:
Here you can change the permissions for the file. File Manager makes it easier by having check boxes to choose your desired permissions:
Once you have put in the new permissions, click Change Permissions. Remember that you should only do this if completely necessary! If you allow more access to your files, it can leave your website vulnerable. If you have any questions, contact our Tech Support and we'll be happy to assist you.