All new files in folder writable by all users in group

I need to make sure that all users in a group have read/write access to all files in a shared folder, old and new files.

First, make sure that all existing files and folders are in the group

chgrp group . -R

And all new files and folders must be in the same group too

chmod g+s . -R

Finally, the files created by all users must have read/write permissions to the group. We must ensure what this command is run whenever a user logs on system.

umask 002

We can ensure that by adding this line to /etc/bashrc.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>