Kolonel 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

  • Gebruiker refers to the file owner.
  • Groep refers to users in the same group.
  • World refers to all other users.

Numeric permissions are calculated by adding values. Bijvoorbeeld, 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-bestanden

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

  • Gebruiker: read and write
  • Groep: lezen
  • World: lezen

Directories

All directories should use 755 permissions.

  • Gebruiker: lezen, write, execute
  • Groep: lezen, execute
  • World: lezen, 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 op uw cPanel-account.
  2. Open de Hulpmiddelen pagina.
  3. In de Bestanden sectie, klikken Bestandsbeheer.
  4. Select the file or directory you want to modify.
  5. Click the Permissions icon in the toolbar.

[Tijdelijke aanduiding voor screenshot: 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. Klikken Change Permissions to apply the update.

[Tijdelijke aanduiding voor screenshot: 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 speciale server.

Was dit artikel nuttig??