User Tools

Site Tools


Sidebar

linux:joomla_file_permissions

This is an old revision of the document!


Joomla file permissions

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).

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). So something like this should be performed for whole Joomla directory (for Ubuntu & spol.):

 cd /var/www/whatever-your-joomla-root-dir-is
 find . -type f -exec chmod 644 {} \;
 find . -type d -exec chmod 755 {} \;
 chown -R www-data:www-data

You may need to change directories with extensions or templates the same way as cache directory only for the time you installing/removing one of them and then change ownership back.

For Fedora, CentOS, RHEL, Scientific Linux etc. command should be:

chown -R apache .

Instead of changing ownership (this could be done as root only) you may just enable write permission for others by this command (and later revert back by passing o-w to the same command):

chmod -R o+w cache
linux/joomla_file_permissions.1511857502.txt.gz · Last modified: 2017/11/28 09:25 by admin