Setting File Permissions

7 vues Website Management

Understanding File Permissions

File permissions (also called chmod values) control who can read, write, and execute files on the server. Correctly configured permissions are essential for both security and functionality of your website.

Permission Basics

Each file and directory has three permission categories:

  • Owner - The user who owns the file (typically your hosting account).
  • Group - Users in the same group as the file owner.
  • Others - Everyone else (public/world).

Each category can have three types of permissions:

  • Read (r = 4) - Permission to view the file contents or list a directory.
  • Write (w = 2) - Permission to modify the file or add/remove files in a directory.
  • Execute (x = 1) - Permission to run the file as a script or access a directory.

Common Permission Values

  • 644 - Owner can read/write; group and others can read only. Standard for most files.
  • 755 - Owner can read/write/execute; group and others can read/execute. Standard for directories and scripts.
  • 600 - Owner can read/write only. No access for group or others. Use for sensitive configuration files.
  • 750 - Owner full access; group can read/execute; others no access.
  • 777 - Full access for everyone. Avoid this setting as it is a security risk.
Never set files or directories to 777 permissions. This allows anyone on the server to read, modify, and execute your files, creating a serious security vulnerability.

Changing Permissions in File Manager

  1. Open File Manager and navigate to the file or directory.
  2. Select the file by clicking its checkbox.
  3. Click Chmod (or Permissions) in the toolbar.
  4. Enter the numeric permission value (e.g., 644) or check/uncheck the permission boxes.
  5. Click Set Permission or Save.

Changing Permissions via SSH

If you have SSH access, use the chmod command:

chmod 644 filename.php
chmod 755 directoryname
chmod -R 644 public_html/*.html
The -R flag applies permissions recursively to all files within a directory. Use it carefully to avoid setting incorrect permissions on subdirectories.
Besoin d'aide ?

Vous ne trouvez pas ce que vous cherchez ? Notre équipe de support est prête à vous aider.

Contacter le support
Bonjour ! Comment pouvons-nous vous aider ?
Discuter