Automatic apply ownership permissions in /home/*

Does anyone know of a way to automatically re-apply owner and group permissions to websites in /home/*

For instance, read all the domains hosted on server, run through each home directory and make sure all files are corrected owned.

Something like this in a script that is run each day would be incredibly handy.

No, I don’t know of a way to do that – but you’ll need to be careful, as not all files in /home/USERNAME/ are necessarily owned by “USERNAME”.

Within /home/USERNAME/users/ are all of that domains email users, where each of their files are owned by the email user, not the Virtual Server owner.

Though, do you frequently run into problems with users and group permissions changing?

Is there a specific issue you’re trying to solve?

Hi Eric,

I occasionally find that some files residing in the public_html directory will be owned by “root” instead of “username”

This will be because I run scripts to upgrade certain files and also because I tend to work on some files and upload them as “root”

Thanks for pointing out that the mail folders have different usernames - phew!

I am hoping that there would be a simple script to simply run through all the files contained in “public_html” and make sure the user and group permissions are correct - perhaps on a daily basis.

Regards Steven