Sharing files with Other Users
You can share files in scratch with one specific user, or with one group, without opening your storage to anyone else. This uses access control lists (ACLs): the sender grants the recipient read access to a directory, the recipient copies the files into their own storage, and the sender then removes the access.
Using these steps typically suggests you are sharing files with users outside your own group (otherwise you can share with the users more directly using group-owned /data shares).
ACLs work on scratch (/scratch on Sol and Phoenix, and /phxscratch on the data transfer node). They do not work on /home or on most /data directories. If the files are in your home directory, first copy them into a directory in your scratch. Never make your home or scratch directory world-readable or world-writable (for example with chmod -R o+rx or chmod 777) to share files.
Sharing Overview
The process goes like this:
- Sender puts the files in a directory in their scratch and grants the recipient read access to it.
- Recipient copies the files into their own storage. The recipient owns the copy.
- Sender removes the recipient's access.
This example uses <sender> and <recipient> to be replaced by actual ASURITEs, and shared as the name of the directory being shared.
1: Connect to the Sol Data Transfer Node
Use this node regardless of whether you wish to do transfers on Sol or Phoenix--this node services both.
ssh <asurite>@soldtn.sol.rc.asu.edu
2: Sender grants access
- Sol
- Phoenix
setfacl -m u:<recipient>:x /scratch/<sender>
setfacl -R -m u:<recipient>:rX /scratch/<sender>/shared
setfacl -m u:<recipient>:x /phxscratch/<sender>
setfacl -R -m u:<recipient>:rX /phxscratch/<sender>/shared
The first command lets the recipient pass through your scratch directory to reach shared, without being able to list or read anything else in it. The second command gives the recipient read access to everything in shared (the capital X adds directory access only to directories). Check the result with getfacl /scratch/<sender>/shared.
To share with a whole group instead of one user, use g:<groupname> in place of u:<recipient>.
Take note, while this step when executed on Phoenix advises the directory "/phxscratch", all copies will always be found in /scratch--it is only this data transfer node that differentiates in order to allow cross-supercomputer transfers.
3: Recipient copies the files
- Sol
- Phoenix
cp -R /scratch/<sender>/shared /scratch/<recipient>/
cp -R /phxscratch/<sender>/shared /phxscratch/<recipient>/
This duplicates the shared directory into the recipient's scratch. The recipient owns the copy, and the copied files get new timestamps, so the 90-day scratch clock starts fresh.
4: Sender removes access
After the recipient has copied the files, the sender removes the access:
- Sol
- Phoenix
setfacl -R -x u:<recipient> /scratch/<sender>/shared
setfacl -x u:<recipient> /scratch/<sender>
setfacl -R -x u:<recipient> /phxscratch/<sender>/shared
setfacl -x u:<recipient> /phxscratch/<sender>
Usage note
This process is one of many ways in which files might be shared with other users. For ongoing sharing, the sender can also add a default ACL (setfacl -R -m d:u:<recipient>:rX /scratch/<sender>/shared) so that new files in shared are readable too.
For regular collaboration and frequent file sharing, project storage (purchasable) is a more sustainable/frictionless experience.