Joomla File Permissions: How to Configure Them Correctly Without Leaving a Hole
Access permissions determine who can read, modify and execute files on the server. If the permissions are set too generously, any script on the site can overwrite the Joomla core files. We have conducted more than 200 Joomla site audits and we often find a serious vulnerability here. Let us look at how to configure the permissions correctly.
How Permissions Work in Linux
In Linux every file and folder has three levels of access: for the owner, for the group and for other users. Each level defines three actions: reading, writing and executing.
For example, the 644 permissions for a file mean:
- The owner can read and modify.
- The group can only read.
- Others can only read.
For folders 755 is used: the owner can do everything, the group and others can only read and enter.
Recommended Permissions for Joomla
The standard values for Joomla files are 644, for folders — 755. Pay special attention to the configuration.php file: after installing Joomla its permissions must be 444 (read-only for everyone).
Basic Permission Settings
Check these values:
- Joomla files —
644. - Joomla folders —
755. configuration.php—444.- The
tmpandcachefolders —755(write access is needed only by the owner).
What You Must Not Do
Never set 777 permissions on Joomla files or folders. This means full access for everyone, including any script on the server. If there is a vulnerability on your site, the attacker will be able to overwrite the core files and gain control of the site.
Some hostings require 777 for correct operation, but this is a sign of a poor server configuration. Modern hostings work with 755 and 644 without problems.
How to Check the Current Permissions
You can check the permissions via the hosting file manager or via FTP. Pay attention to the files that have been changed recently: if their permissions differ from the standard, this may be a trace of a hack.
If you have found non-standard permissions on several files, especially on index.php or configuration.php — this is a reason to conduct a full audit. We have a Technical Joomla Audit service: we check the code, structure, access permissions and security in 1–2 days, and give a clear report with priorities.
File Ownership
Besides access permissions, file ownership matters. Joomla files must belong to your user on the server, not the web server. If the files belong to the web server, an attacker through a vulnerability will be able to modify them even with 644 permissions.
You can check the owner in the hosting file manager. If you are not sure that it is configured correctly — contact the support.
If the Site Has Already Been Hacked Through Access Permissions
If the attacker took advantage of the wrong permissions and uploaded malicious code — first the site needs to be cured, and then the permissions need to be configured. The Malicious Code Removal service includes checking the files for shells and backdoors. And after the treatment it is worth setting up protection — Joomla Security and Firewall.
"Access permissions are not something you set up once and forget. After every change to the site, check that nothing has shifted."
If you are not sure that the access permissions are configured correctly, or suspect that they were changed during a hack — start with a technical audit. It will take less time than recovery after an attack.