Skip to Main Content

Department of Computer Science

Technical Services and Support

Sharing Directories

Making a Directory You Can Share With Members of Your Project

This document shows you how to make a directory and share it with members of your project in  /common/user/shared/GROUPNAME.

Please remember that any files you store count against your /common/users/NETID quota. See Storage Technology Options for the disk quota and information about our storage system.

Here are the steps to follow: 

1. Create  Appropriate Groups 

You’ll need to create a user group for your team. You can pick the name of the group. Please don’t use names starting with any of the following:
login, disabled, slide, cs, dept.
If you do, our software may take over without warning and drop you and your members.

Recommendations for group names. (You can use some others, but these are safest.)

    •   Must start with a-z or _
    •   Characters after the first may also be digits or hyphens
    •   No longer than 32 characters

Here are the most common operations on groups with the group name GROUPNAME using command lines.

• Create group:  ipa group-add GROUPNAME
• Delete group:  ipa group-del GROUPNAME [you’ll get an error message, but the deletion still happens]
• Add someone to the group (don’t forget to add yourself):  ipa group-add-member GROUPNAME --users=NETID
• Remove someone from the group:   ipa group-remove-member GROUPNAME --users=NETID
• To look at the group and its members: ipa group-show GROUPNAME
• To see what groups you are in:  groups   [if you add someone to a group, they won’t see it until the next time they log in]
• Another way to see information about yourself:  ipa user-show NETID  [this may show groups that the groups command doesn’t, because some groups are, in effect, invisible]


NOTE: The new group may be available for 15-20 minutes.  Continue to Step 2 below once you know the group is available.


2. Making a Shared Directory

Once you have a group for your team, here are the commands to make a shared directory. We have allocated a directory for sharing at /common/users/shared to simplify the process.  We recommend you name the directory the same as your GROUPNAME. Here are the steps:

mkdir /common/users/shared/GROUPNAME
chgrp GROUPNAME /common/users/shared/GROUPNAME
chmod 2770 /common/users/shared/GROUPNAME

Here’s what the commands do:

• The mkdir command makes the directory in /common/users/shared with GROUPNAME.
• The chgrp command sets it so your group can access the /common/users/shared/GROUPNAME directory.
• The chmod command sets the permissions to let your group members look at, create, and delete files in the directory. The leading two ensure that any files or subdirectories created inherit the group.

Verifying what was done using ls -ld, the output should look like this:

drwxrws--- 2 NETID GROUPNAME 10 Sep 25 14:04 /common/users/shared/GROUPNAME/
The critical part of the output is the drwxrws---  which gives the GROUPNAME directory full access to GROUPNAME members.
 
3. Setting Access to File Inside Shared directory

Any file you created in /common/users/shared/GROUPNAME will be visible to GROUPNAME, but it does not mean the file is readable or writeable to your group members.  If you need everyone in the GROUPNAME to be able to read/write the file, you’ll have to make sure GROUPNAME can do so.  For suppose you want an existing file /common/users/shared/GROUPNAME/file2share  to be set so that GROUPNAME member can read/write it, do the following:

cd /common/users/shared/GROUPNAME
chmod 660 file2share

Verify using ls -l . The output should look like this:

-rw-rw---- 1 NETID GROUPNAME  175 Sep  7 12:52 file2share

The critical part of the output is the second “rw”. That applies to other members of your group. The last three characters, “—” are for people not in your group without access to the file.

4. Accessing Files inside Share Directory

Now that you have created a shared folder, members of GROUPNAME can access the files inside /common/users/shared/GROUPNAME using the following command:

cd /common/users/shared/GROUPNAME