Unix Groups


UNIX groups allow you and your partner to work on the same files without sharing passwords or actually logging into the same account. You and your partner (and no one else) can become members of the same UNIX group. Then, directories and files you are working on can be made readable and writable to that group, so that only you and your partner can read and modify them. (The files will reside under the home directory of only one of you... but you don't need to log into each other's accounts or share passwords.) To take advantage of this, do the following.

  1. From one of your accounts, after prepping into the cs131f environment
        prep cs131f
    run the command
        requestgroup
    and enter your login names.

  2. ACS will then create a unique group containing just the 2 logins you requested. (Unfortunately this may take a few days.) You can tell when your group has been set up: run the command
        groups
    This will show the groups you are in. The new ACS-created group will appear as something like cs131f_#. When you see that, you are ready to proceed.

  3. In one of your accounts, say joeuser, create a directory you want to use as your shared working directory, say Project1:
        cd
        mkdir Project1
    Make sure this directory has its group sticky bit set:
        ls -ld Project1
    You should see something like:
        drwxrws---   2 joeuser cs131f      4096 Jan  3 22:13 Project1
    That 's' at the end of drwxrws--- is the group sticky bit.

  4. Now make that directory's group ID be the new group you and your partner are in by running the chgrp command:
        chgrp cs131f_# Project1
    Do a ls -ld again to make sure the group ID has changed:
        ls -ld Project1
        drwxrws---   2 joeuser cs131f_#      4096 Jan  3 22:13 Project1
  5. You have to do one more thing: set the world 'x' bit on your home directory (the one containing the Project1 directory):
        chmod o+x .
  6. Now you can copy the contents of the public/starterCode/ to your shared Project1 directory. Assuming you are still logged in as joeuser, something like
        cp -r ~/../public/starterCode/* ~/Project1/
  7. Now either of you in the group can cd to that Project1 directory, create, read, and write files and directories, etc. To make it even more convenient, the other member of your group can create a symbolic link to the shared project directory under their own home directory. When logged into the other/partner account, do:
        ln -s /home/solaris/ieng9/cs131f/joeuser/Project1 .