Using Unix Groups for Group Projects
If you are going to be working in a group for your projects, you might
want to be able to share files with your group members. This will
allow group members read (and write, if you'd like) access to project
files.
Here's what you need to do:
- Form your group.
- Request the creation of a Unix group for a class project.
You'll need to contact Mary Bailey for this. She will need the
usernames of your group members.
- Once the group has been created, new login sessions for all
group members will include group permissions. Try the Unix command
groups to see which groups you are in. Your new group should be
listed.
- Pick a location for your group's work. This will be in a group
member's account. Create a directory.
- Change the permissions on the directory to permit access to all
group members. The following assumes you want to add read/write
access for all group members of group 432grp on the directory
432proj.
- Change group ownership of the directory: chgrp 432grp
432proj
- Permit group read/write/execute: chmod g+rwx 432proj
- Set the "setgroupid" bit on the directory. This will force
any files and directories you create inside of 432proj to
have group ownership 432grp: chmod g+s 432proj
- Remove all permissions from non-group members: chmod
o-rx 432proj
All of the chmod steps above can be combined into a single
command: chmod 2770 432proj - see chmod(1) for details.
ls -lg will list your files including group information.
- Make sure group members have appropriate permissions on the
parent directories that will allow them to cd to the group
directory. The requires only world execute permissions, but not read
permissions on parent directories. This will allow cd, but not
ls.