Changing Multiple Directory and File Permissions

After setting up your website it is always a good idea to change the directory and file permissions.  This makes it a little harder for an attacker to compromise your site.  For Joomla and WordPress it is best practice to set your directory permissions to 755 and your file permissions to 644.  In addition to this, WordPress recommends setting the wp-config.php file to 600.

 

Using the code below, go to the root directory of your website and run the following commands.

 

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *