Each file and directory(folder) in your account has permissions which control who can read, write and execute that file. When files are created, default permissions are assigned. Most users won't need to change permissions, but there are times when an update, instalaltion, etc. will require a file permissions change.

Levels of Access

There are three levels of access for files:

  • User: Owns the file
  • Group: All users are part of a group of users. The group the file owner belongs to can be granted permissions on the file as set by the owner of that file
  • World: Everyone else who isn't either the owner of the file or in the file owner's group.

Permission Types

There are three types of permissions:

  • Read
  • Write
  • Execute

Each of those permissions can be set for each of the access classes.

Viewing File Permissions

File permissions can be viewed and changed through either the cPanel File Manager or most FTP programs. We'll walk you through viewing and changing your permissions through the cPanel File Manger here.

File permissions in the cPanel FIle manager will be represented by numbers instead of letters.  The numbers are as follows:

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

Let's look at an example below:

cpanel-view-file-permissions

In the image above you can see the permissions for each file listed on the right side of the screen. Probably the most important thing to keep in mind is that certain file types and folders should be set to particular permissons. Below are some examples:

public_html - 750
Folders - 755
CGI and Perl scripts - 755
.html .php and other Document Types - 644

What to do when permissions are set wrong

Incorrect file permissions can cause errors or even worse, allow unauthorized users to hack your site. Once an unauthorized user gains access, they can further alter more of your file permissions to make a site even more vulnerable. Remember that 777 permissions means that your file is readable, writeable and executable by the "world". This is not common, as it is a rare situation where a file needs to be written and executed by the "world." If you find files or folders with permissions that do not match the default permissons, it's usually best to change them to the recommended permissions.

How to change file permission settings

You can change the permissions for files through the cPanel File Manager or in your preferred FTP program. In File Manager, locate the file you wish to change the permissions for. Next, right click and select Change Permissions from the menu (or select the icon near the top of the screen).

cpanel-change-file-permissions

This will bring up the Change Permissions window where you can adjust the settings as needed by checking the box by each permission you want for each level of access (User, Group and World).

cPanel-file-permissions-change

Once you are finished editing your file permissions, click the "Change Permissions" button.

Keep in mind that you should only change file permissions if needed. You want to make sure that you aren't allowing more access to your files than is necessary, since that can leave your website vulnerable. If you have any questions or need additional assistance changing file permissions, please contact our support team and we'll be happy to help you.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Drupal permisssion issues
Internal Server Error when installing Joomla Extension
com_virtuemart.shoppers.ini not loading
cannot use php 5.3
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!