Colonel Server

File permissions control who can read, modify, or execute files and directories on a Linux based hosting environment. Correct permissions are required for websites to function properly while maintaining security.

Understanding Linux file permissions

Each file and directory has three permission types applied to three user classes.

Permission types

  • Read (r or 4) allows viewing file contents.
  • Write (w or 2) allows modifying file contents.
  • Execute (x or 1) allows running files or accessing directories.

User classes

  • User refers to the file owner.
  • Group refers to users in the same group.
  • World refers to all other users.

Numeric permissions are calculated by adding values. For example, read and write permissions for the user equal 6, while read only permissions for group and world equal 4. This results in a permission value of 644.

Recommended permission settings

Web servers must be able to read files and access directories to serve content correctly. The following settings are commonly used on cPanel hosting services.

Website files

HTML, image, and static content files should use 644 permissions.

  • User: read and write
  • Group: read
  • World: read

Directories

All directories should use 755 permissions.

  • User: read, write, execute
  • Group: read, execute
  • World: read, execute

CGI scripts

Executable scripts located in the cgi-bin directory must use 755 permissions. These permissions are not always applied automatically and may require manual adjustment.

Security warning

No file or directory should be writable by the world. World writable permissions can allow unauthorized users to modify or delete your data.

Changing permissions using File Manager

Permissions can be adjusted directly from the cPanel interface.

  1. Log in to your cPanel account.
  2. Open the Tools page.
  3. In the Files section, click File Manager.
  4. Select the file or directory you want to modify.
  5. Click the Permissions icon in the toolbar.

[Screenshot placeholder: File Manager toolbar with Permissions icon]

Setting permission values

  1. Use the checkboxes to enable or disable read, write, and execute permissions.
  2. Review the numeric permission value shown below the checkboxes.
  3. Click Change Permissions to apply the update.

[Screenshot placeholder: Change Permissions dialog]

Changes take effect immediately. Incorrect permissions may cause access errors or expose security risks, especially on environments connected to cloud servers or larger infrastructures such as a dedicated server.

Was this article helpful?