Securing file permissions and ownership