How to Change File Permissions

Understanding the cPanel File manager


Let us begin with an introduction to cPanel's File Manager, and describe how to complete basic file management tasks.

  •     Starting File Manager and browsing the filesystem
  •     Creating new folders and files
  •     Copying, moving, renaming, and deleting files
  •     Searching for files

You may also want to read:

Filezilla usability and functionality

 How to Fix FTP Connectivity Issues

 How to check the log of an FTP client

 Understanding FTP and How to Use it for File Transfer

Starting File Manager and browsing the filesystem

cPanel's File Manager makes it easy for you to browse through your web site's directories.

To start File Manager and navigate through the directory hierarchy, follow these steps:

    In the Files section of the cPanel home screen, click File Manager.
    Select the directory that you want to open, and then click Go. The File Manager main window appears.
    Browse the directory hierarchy:
        To view a directory, click the directory name.
        To move up a level in the filesystem, click Up One Level.
        To expand a directory, click the + icon.
        To collapse a directory, click the - icon.

Creating new folders and files

It is easy to create a new folder or file in File Manager.

To create a new folder, follow these steps:

    In the File Manager main window, click the New Folder icon.
    In the New Folder Name text box, type the name of the new folder.
    In the New Folder will be created in text box, make sure that the path is where you want to create the folder.
    Click Create New Folder.

To create a new file, follow these steps:

    In the File Manager main window, click the New File icon.
    In the New File Name text box, type the name of the new file.
    In the New file will be created in text box, make sure that the path is where you want to create the file.
    Click Create New File.

You may also want to read:

Filezilla usability and functionality

 How to Fix FTP Connectivity Issues

 How to check the log of an FTP client

 Understanding FTP and How to Use it for File Transfer

Copying, moving, renaming, and deleting files

To copy, move, rename, or delete files, follow these steps:

    In the File Manager main window, select the file or files.
    Do the file operation that you want:
        To copy the file, click the Copy icon, type the destination directory, and then click Copy File(s).
        To move the file, click the Move icon, type the destination directory, and then click Move File(s).
        To rename the file, click the Rename icon, type the new filename, and then click Rename File.
        To delete the file, click the Delete icon, and then click Delete File(s).

Searching for files

You can use File Manager to search for a particular file or set of files. For example, you can search for all files that have the word quota in their filenames.

To search for a file, follow these steps:

    In the top-right corner of the File Manager main window, select the location to search for the file in the Search list box. You can search for files in the following locations:
        In all of your files (that is, in your home directory and in all subdirectories beneath it).
        In only your public_html directory.
        In the current directory.

    In the text box, type the name of the file that you want to find, and then click Go.

You may also want to read:

Filezilla usability and functionality

 How to Fix FTP Connectivity Issues

 How to check the log of an FTP client

 Understanding FTP and How to Use it for File Transfer


How to Set, Change File Permissions in Filemanager

  • About file permissions
  • File permission settings for your web site
  • Changing permissions for a file or directory
  • More Information
  • Related Articles

About file permissions

All files and directories on Linux computers have access permissions that tell the operating system how to handle access requests. There are three basic access permissions:

  • Read: Files with read access enabled can be viewed by the user. The read permission is represented by the letter r or the number 4.
  • Write: Files with write access enabled can be modified by the user. The write permission is represented by the letter w or the number 2.
  • Execute: Files with execute access enabled can be run as programs by the user, and directories with execute access enabled can be accessed by the user. The execute permission is represented by the letter x or the number 1.

These three access permissions are then set for three types of user groups:

  • User: The owner of the file.
  • Group: Other users who are in the same group as the group to which the file belongs.
  • World: This access type is for everyone else; that is, those who are not the user or who are not in the same group.

You can determine the full permission settings for a file or directory by combining access permissions and access types. For example, a file with read and write permissions for the user has a permissions value of 6. (The read value of 4 plus the write value of 2 equals 6.) If that file also has read permissions for the group and the world, those permissions values are 4. So the file's total permissions value is represented numerically as 644.

File permission settings for your web site

A web server must be able to access your site's files in order to send them to a user's web browser. Therefore, your files must have the correct file permissions set for your web site to work properly.

None of your files or directories should be writable by anyone else. If other users can write to your files or directories, then they can also erase them.

The following tables show the correct permission settings for various file types on your web site:

  • All HTML files and image files must be readable by others (the world). The correct file permissions setting is 644, and it is set automatically when you upload files to your site. The following table shows these permission settings:

 

User

Group

World

Read

Set

Set

Set

Write

Set

-

-

Execute

-

-

-

Permissions

6

4

4

  • All directories must be executable by others (the world). The correct file permissions setting is 755, and it is set automatically when you create a directory on your site. The following table shows these permission settings:

 

User

Group

World

Read

Set

Set

Set

Write

Set

-

-

Execute

Set

Set

Set

Permissions

7

5

5

  • All CGI files (that is, all files in your cgi-bin directory) must be executable by others (the world). The correct file permissions setting is 755, but it is not set automatically when you upload CGI files to your site. You must change the file permissions for CGI files manually. The following table shows these permission settings:

 

User

Group

World

Read

Set

Set

Set

Write

Set

-

-

Execute

Set

Set

Set

Permissions

7

5

5

Changing permissions for a file or directory

To change the permissions for a file or directory, follow these steps:

  1. In the File Manager main window, select the file or directory that you want to change.
  2. Click the Change Permissions icon.
  3. Click the check boxes to set the correct permissions.

The numerical permission values underneath the check boxes update automatically as you add and remove permissions.

  1. Click Change Permissions.


How to Change File Permissions Using FTP (CHMOD)

This section shows you how to change the permissions of your files via FTP.

What is CHMOD?

CHMOD is a UNIX command that changes the mode of a file. There are three modes which can be either enabled or disabled: read, write and execute. Each mode can be set for either the owner, the members of the owner's group, or all users.

Here you will find detailed instructions how to change the permissions of a file using SmartFTP. SmartFTP is an FTP client which can be downloaded from here. SmartFTP is fully compatible with our FTP hosting services.
How to use CHMOD?

When you have downloaded and installed the FTP client, connect to your FTP server. (If you have an account with Todhost, use the username and the password of your cPanel.)

Once connected, you will need to locate the file(s)/folder(s), for which you would like to change the permissions. In this example, we will change the permissions on the public_html/cache folder and all of the subdirectories/files within it.

Right-click on the cache folder located in public_html. A new menu will appear as shown below. Click on Properties / CHMOD.

A new window will popup. In this new window there is a field Permissions. Change the value in this field to the appropriate number as specified by the documentation of the product you're using. In this example, we will change the value to 750 as shown below.

You may want to change the permissions of all the files and subfolders under the cache directory. SmartFTP has a useful feature that allows you to change the permissions recursively. This means that the permissions you have entered in the Permissions field will also be applied to all of the files and subfolders of your current selection. To do this, click the checkbox next to Apply changes to this folder, subfolders and files as shown above.

The execution can take several minutes if you are changing the permissions of a lot of files.

The execution can take several minutes if you are changing the permissions of a lot of files
  • 34 Users Found This Useful
Was this answer helpful?

Related Articles

Understanding FTP and How to Use it for File Transfer

What is FTP? FTP (File Transfer Protocol) is a fast and convenient way to transfer files over...

How to Fix FTP Connectivity Issues

FTP issues could arise due to different reasons. The likely causes are incorrect login details,...

Filezilla usability and functionality

Filezilla usability and functionality. FileZilla has various options which eases its usage and...

How to check the log of an FTP client

How to check the log of your favourite FTP client:The FTP log can be very useful when you...

Powered by WHMCompleteSolution