brock

How to Change Attributes for all Files and Folders

02 Nov 2008

I am regularly working with WordPress and need to change the attributes of my files and folders so that it is locked down and secure. This is a two step process. I first change the attributes of all files to 644. Then I change the attributes of all folders to 755. However, you should decide what is best for you by reading the article on the Codex called Changing File Permissions if you are new to this topic.

This can be done from anywhere, since I always type out the full path to the location so I know I'm not making any mistakes. I enter the following to change all files:

sudo find [enter path here. ex: /var/www/wordpress] -type f -exec chmod 644 {} \;

And I follow that up by entering the following for folders:

sudo find [enter path here. ex: /var/www/wordpress] -type d -exec chmod 755 {} \;

And you're done.