Colonel Serveur

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

  • Utilisateur 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. Par exemple, 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 autorisations.

  • Utilisateur: read and write
  • Group: lire
  • World: lire

Directories

All directories should use 755 autorisations.

  • Utilisateur: lire, write, execute
  • Group: lire, execute
  • World: lire, execute

CGI scripts

Executable scripts located in the cgi-bin directory must use 755 autorisations. 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. Ouvrez le Outils page.
  3. Dans le Fichiers section, faire un clic File Manager.
  4. Select the file or directory you want to modify.
  5. Cliquez sur le 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. Faire un clic 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 serveurs cloud or larger infrastructures such as a serveur dédié.

Cet article a-t-il été utile?