Managing File permissions

Categories Web HostingFile Management Tags file transferftp

Netregistry uses a Unix-like file storage system for all our website hosting plans. This means traditional Unix permissions are applied to all files uploaded to our servers. File permissions tell the server which users can read, write or execute a file or folder. Leaving a file or folder set to an insecure permission, such as a 777, can be very dangerous. Instructions on how to do this can be found below.

Modify file permissions using FileZilla

FileZilla is a free FTP client used to upload, download and manage website files. The software allows users to modify the permissions of the files and directories hosted in their accounts. Follow the instructions below in order to modify the permissions to your files and directories using FileZilla.

  1. Use FileZilla to connect to the server
  2. Right click on the files/folders you wish to update the permissions to
  3. Select File Permissions from the drop down menu
  4. Select the appropriate boxes or type in the Numeric Value of your new permission
  5. Click [OK]

If you use an alternative FTP client, please see it's documentation on how to modify file permissions.

Modify file permissions using the Cloud Hosting File Manager

  1. Log into your Account
  2. Manage the domain you want to make changes to
  3. Click Cloud Hosting
  4. Click Manage + Upload using File Manager
  5. Right click on the file or directory you want to modify permissions to
  6. Select File Permissions from the drop down menu
  7. Select the appropriate boxes or type in the Numeric Value of your new permission.
  8. Click [OK].

Modify file permissions using File Manager (cPanel hosting)

  1. Log into your Account
  2. Manage the domain you want to make changes to
  3. Click cPanel
  4. Click File Manager
  5. Select the Home Directory
  6. Click [Go]
  7. Navigate into the public_html directory
  8. Right-click on the file or directory that you want to update the  permissions to
  9. Click Change Permissions
  10. Select the appropriate boxes or type in the Numeric Value of your new permission
  11. Click [Change Permissions] to save your changes

Types of permissions

Files:

  • Read - The file can be read
  • Write - The user or process can write to and change the file
  • Execute - The file can be executed or run

Directories:

  • Read - The directory listing can be obtained
  • Write - The directories contents can be written to. New files can be created or existing files deleted
  • Execute - The directory can be accessed

Who has these permissions

Unix-like file permissions are made up of a group of 3 numbers known as an octal representation, e.g. 644. This number represents three types of permissions that must be granted to a given file: Owner, Group, Others.

  • Owner - specifies the individual owner of a given file or directory
  • Group - specifies a defined group to whom permissions may be granted as a collective, and only those members of that group
  • Others - specifies that permission may be granted to anybody attempting to access it

File Permission Values

The following values are used for Owners, Groups and Others to form permission.

Value Description Permissions
0 no access ---
1 execute --x
2 write -w-
3 write and execute w-x
4 read r--
5 read and execute r-x
6 read and write r-w
7 read, write and execute (full access) rwx

Common file permissions

Value Description Information
644r-wr--r-- 6 - Owner has read and write permissions
4 - Group has only read permissions
4 - Others have only read permissions
Allows only the owner to make changes to the file or directory.
755rwxr-xr-x 7 - Owner has read, write, and execute
5 - Group has read and execute permissions
5 - Others have read and execute permissions
Required to install some scripts or to browse to a required directory.
777rwxrwxrwx 7 - Owner has read, write, and execute permissions
5 - Group has read, write, and execute permissions
5 - Others have read, write, and execute permissions
Should never be used, because then anyone can modify these files at any time.

Note: 777 file permissions allow for anybody to read, write, or execute the file, and as such, expose the file to potential malicious threats.  Always change file permissions to restrict access.  Every single file and folder stored on the hard drive has a set of permissions associated with it, which says who is allowed to do what with the file. Every file (and folder) also has an "owner" and a "group" associated with it. If you created the file, then you are usually the owner of that file, and your group, or the group associated with the folder you created the file in, will usually be associated with that file.

Rate this article