Okay, the first thing to understand is that you can't create a group
and set it to have default permissions.
Permissions are determined by the umask of the user who creates a
file. So if you want all members to have access to files which are
created, each of the members must have a umask that gives read and
write permission to the group. (Just ask if you have questions about
the umask command.)
The second thing to understand is which group will be associated
with a new file. If the SGID bit is set on the parent directory,
the file will be associated with the group of the parent directory.
If the SGID bit is not set, the group will be the user's group
that is included in the /etc/passwd file.
So...you can create a directory and set its SGID bit to make a
shared directory for a group. Then you'll just need to set the
umask for each member. Here is one way to accomplish this:
Code:
groupadd group1
mkdir -p /var/project/group1
chgrp groupadd /var/project/group1
chmod 775 /var/project/group1
chmod g+s /var/project/group1
gpasswd -a user1 group1
echo umask 002 > ~user1/.bash_profile
gpasswd -a user2 group1
echo umask 002 > ~user2/.bash_profile
Obviously this is an example that may need to be adjusted.
For example, your users may not use .bash_profile files.
If you have questions, be sure to post them.