Skip to main content

Sharing Files

The Social Sciences Computing Cluster serves many people in one computing environment. Providing access to your files, either for instruction, research collaboration or research publication (within the cluster) is possible. This document describes how to set up a subdirectory tree of files for other users to be able to read only.

Sharing A Subdirectory of Files Read-Only

Login to your SSCC account, and make sure that you're in your HOME directory by typing the command cd with no other arguments:

[abc123@hardin ~]$ cd

Now give your HOME directory the minimum group access rights to allow other SSCC users to access your subdirectory thru your HOME directory. Give your HOME directory group search access only:

[abc123@hardin ~]$ chmod g=x $HOME

Create the subdirectory you will share files from:

[abc123@hardin ~]$ mkdir Labor

Give the Labor directory read and search access:

[abc123@hardin ~]$ chmod g=rx Labor

Having done this, other SSCC users can list the names of the files in your Labor directory if they know the path to that directory: ~abc123/Labor

Put the files you want to share in your Labor subdirectory. You can include subdirectories as well, just make sure that each subdirectory you create is given the same g=rx access permissions.

Now, give all of the files in the Labor directory tree group read access:

[abc123@hardin ~]$ chmod -R g+r Labor

Finally, have someone check your work from another account by trying this ls command (showing example output below):

[xyz987@seldon ~]$ ls -lR ~abc123/Labor | more
/sscc/home/a/abc123/Labor:
total 68
-rw-r----- 1 abc123 users 2246 Jun 28 2002 acl.log
-rw-r----- 1 abc123 users 8434 Jun 28 2002 acl.lst
-rw-r----- 1 abc123 users 995 Jan 25 2000 acl.out
-rw-r----- 1 abc123 users 38918 Feb 5 1997 acl.out.save.gz
-rw-r----- 1 abc123 users 458 Jan 27 2000 acl.sas
-rw-r----- 1 abc123 users 210 Jan 25 2000 acl.sps

That command should list the entire directory tree of files and subdirectories within your Labor directory without any access error messages. That proves that others can get to your files.

Then have that other user verify that others have read access to all of your files with this find command (with example results below):

[xyz987@seldon ~]$ find ~abc123/Labor -type f -exec file '{}' ';'
/sscc/home/a/abc123/Labor/acl.log: ASCII English text
/sscc/home/a/abc123/Labor/acl.lst: ASCII English text
/sscc/home/a/abc123/Labor/acl.out: ASCII text
/sscc/home/a/abc123/Labor/acl.out.save.gz: gzip compressed data
/sscc/home/a/abc123/Labor/acl.sas: ASCII English text
/sscc/home/a/abc123/Labor/acl.sps: ASCII text

This complicated find command executes the command file on every file (-type f) in your ~abc123/Labor directory tree. The file command reads the first few bytes of each file to determine the type of file it is, thereby verifying that other users have read access to your files.

Make sure that you enter -type f -exec file '{}' ';' exactly as you see it, spaces included. Change ~abc123/Labor to the path to your own home directory and directory to be shared.

Notes

Never share files from your HOME directory. Always create a subdirectory from which to share files.

The approach given here only facilitates sharing files with other SSCC users who are running jobs on SSCC hosts.

Other SSCC users cannot list the names of the files in your HOME directory. They must specify the complete path to the directory being shared before they can list the files in that directory.

If you wish to share executable programs or shell scripts, give those files g=rx permission.

If you put new files or directories into your shared directory, you must make sure they have the proper group access permissions.They will not inherit the permissions of other files in your shared directory. You should explicity redo the steps outlined above to ensure that others can share your files.

Last Updated: 24 January 2017

Get Help Back to top