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
- Benutzer refers to the file owner.
- Gruppe refers to users in the same group.
- World refers to all other users.
Numeric permissions are calculated by adding values. Zum Beispiel, 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-Dienste.
Website files
HTML, Bild, and static content files should use 644 permissions.
- Benutzer: read and write
- Gruppe: lesen
- World: lesen
Directories
All directories should use 755 permissions.
- Benutzer: lesen, write, execute
- Gruppe: lesen, execute
- World: lesen, 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.
- Melden Sie sich in Ihrem CPANEL -Konto an.
- Öffnen Sie die Werkzeuge Seite.
- Im Dateien Abschnitt, klicken Dateimanager.
- Select the file or directory you want to modify.
- Klicken Sie auf Permissions Symbol in der Symbolleiste.
[Screenshot-Platzhalter: File Manager toolbar with Permissions icon]
Setting permission values
- Use the checkboxes to enable or disable read, write, and execute permissions.
- Review the numeric permission value shown below the checkboxes.
- Klicken Berechtigungen ändern to apply the update.
[Screenshot-Platzhalter: Change Permissions dialog]
Changes take effect immediately. Incorrect permissions may cause access errors or expose security risks, especially on environments connected to Cloud-Server or larger infrastructures such as a Dedizierter Server.