This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:joomla_file_permissions [2017/11/28 09:24] admin |
linux:joomla_file_permissions [2017/11/28 09:28] (current) admin |
||
---|---|---|---|
Line 3: | Line 3: | ||
This is very dangerous to have all Joomla! files and directories writable for webserver. | This is very dangerous to have all Joomla! files and directories writable for webserver. | ||
- | If any bug in Joomla! or in some extension, the attacker will be able to remove/change/delete any file through the random exploit (utilizing the bug in PHP code). | + | If any bug in Joomla! or in some extension, the attacker will be able to remove/change/delete any file through the random exploit (utilizing the bug in PHP code). |
Instead of this, all files should be only readable by web server (ie: owner should be root or the normal user you have) and all permission sould be 755 for directories and 644 for files. | Instead of this, all files should be only readable by web server (ie: owner should be root or the normal user you have) and all permission sould be 755 for directories and 644 for files. | ||
+ | |||
Only the cache directory should by writable by www server (if you use caching). | Only the cache directory should by writable by www server (if you use caching). | ||
So something like this should be performed for whole Joomla directory (for Ubuntu & spol.): | So something like this should be performed for whole Joomla directory (for Ubuntu & spol.): | ||
Line 13: | Line 15: | ||
find . -type d -exec chmod 755 {} \; | find . -type d -exec chmod 755 {} \; | ||
chown -R www-data:www-data | chown -R www-data:www-data | ||
+ | </code> | ||
+ | |||
+ | Meybe can be changed permissions for cache and tmp in joomla directory: | ||
+ | |||
+ | <code bash> | ||
+ | chmod -R o+w tmp | ||
+ | chmod -R o+w cache | ||
</code> | </code> | ||