Changing owners and groups on linux
Linux/Unix file permissions is one area that can cause problems if we do not handle them correctly. Websites may not run correctly if they don't have access to all required files. Installing modules and components into CMS's can also cause problems if user permissions are different to our website's permissions.
To change owners and groups we do the following:
/* changing owner and group permissions on our backup directory */
/* example chown owner.group directory */
chown website.www-data /var/www/backups/
If we want to change our owners and groups on our directory and all files and directories under it, otherwise known as recursion, we do the following:
/* recursively changing owner and group permissions on our backup directory */
chown -R website.www-data /var/www/backups/
Changing permissions on our files can fix a lot of problems when programs and systems don't work correctly. A lot of time error messages are inadequate with these programs and systems and they do not let you know why they aren't working properly. A good solution is to double check all files have correct owners and groups associated with them. A lot of times errors can come down to a simple permission problem.