Sometimes when we upload files via FTP software or install mods or plugins via a forum or blog, etc. the directory and file ownership and/or permissions can get screwed up and cause problems. Here's an quick and easy way to fix this! Just run the following commands in your SSH client. Just make sure you change to the parent directory that you wish the changes to occur using the " cd " command then type one or more of the following to suit your needs. Note that changing permissions is called " chmod " and changing ownership is called " chown ":
For directories and their subdirectories. Please note that you can change " 0755 " to suit your needs:
- sudo find . -type d -print0 | xargs -0 chmod 0755
For files within a directory or directories. Please note that you can change " 0644 " to suit your needs:
- sudo find . -type f -print0 | xargs -0 chmod 0644
This will change ownership of ALL directories and files within the specified ' directory ". Note that the " -R " option makes this possible:
- sudo chown -R username:usergroup /path/to/directory
To change the directory itself but not the directories and files within it, just use the following:
- sudo chown username:usergroup /path/to/directory