SFTP Server Overview:
The Lab offers an SFTP server to provide a secure way for sharing data from GRID with external collaborators. The SFTP server address is sftp.cshl.edu and can only be accessed by users with accounts using SSH keys (passwords will not work). You must submit a ticket for the external collaborator to generate their account, the ticket will ask for required fields such as name, public SSH key, and the location on grid where the data to share is located. PI approval is required for new accounts, even SFTP accounts.
GRID Setup:
To get started, it is recommended to create a specific folder on grid to place a copy of the data you would like to share with the specific collaborator. Be advised that depending on file permissions, the external collaborator will have Read/Write access to any data in the location you specify which is why we recommend sharing a copy of the data (not the original) in a location you create just for this sharing of data.
For example if I am the user "lindsey" and in my grid home directory is /grid/it/home/lindsey. I want to share data from a research project named "Death Star Plans" with only specific external collaborators and not the general public, I'll create a folder in my grid share "/grid/it/home/lindsey/SFTP/DeathStar". I created the SFTP folder to organize all my potential data to share, and this specific project folder DeathStar inside of that. Next I will copy all the data I want to share from its original location to the DeathStar folder. For example I'll copy the file "weak_exhaust_port_report.pdf" into the DeathStar folder. Make a note of the path you create, we will need it to create the ticket. Below is an example for creating the folder and copying data into it.
[lindsey@bamhead1 ~]$ pwd
/grid/it/home/lindsey
[lindsey@bamhead1 ~]$ mkdir -p SFTP/DeathStar/
[lindsey@bamhead1 ~]$ cd SFTP/DeathStar/
[lindsey@bamhead1 DeathStar]$
[lindsey@bamhead1 DeathStar]$ cp ../../weak_exhaust_port_report.pdf .
[lindsey@bamhead1 DeathStar]$ pwd
/grid/it/home/lindsey/SFTP/DeathStar
[lindsey@bamhead1 DeathStar]$ ls
weak_exhaust_port_report.pdf
[lindsey@bamhead1 DeathStar]$
Creating the Ticket:

Have the external collaborator generate SSH keys and give you the PUBLIC key so you can enter it in the ticket and we can add it to the server so they can login with their corresponding private key. Ensure the category and required fields are correct and hit the Submit button. After some time the user will be created and the ticket will be updated as such.
Accessing Data:
You can also use the terminal to SFTP with the command:
sftp -i "/path/to/private/key" user@cshl.edu@sftp.cshl.edu
When the user logs in, they will be placed in a
directory on the sftp server with two folders, dev and sftp-data. The dev folder is for logging and system use, the sftp-data folder is the one linked from grid where the user will see the data copied into it. In our example above, the file "weak_exhaust_port_report.pdf" will be inside the sftp-data folder, see below:
[lindsey@arrakis ~] $ sftp -i /home/lindsey/darth.vader.key darth.vader@cshl.edu@sftp.cshl.edu
Connected to sftp.cshl.edu.
sftp> ls
dev sftp-data
sftp> cd sftp-data/
sftp> ls
weak_exhaust_port_report.pdf
sftp>
Generating SSH Keys:
The important part about key pairs are there is a public and private key, have the user provide their PUBLIC key and they must keep their private key a secret.
FAQ:
Q: I'd like to share my data with more than one person, do I have to make folders for each one?
A: Nope. In the ticket body explain you have more than one user, and provide each users first and last name and corresponding public key. You must also fill out the required field, so use one of the users names/keys for that.
Q: A user has multiple keys, is that allowed?
A: Yes. Provide the additional key in the ticket body and it can be added to the user account.
Q: I want to share multiple folders with a user, can I do that?
A: The way our SFTP server is set up, we can only link one folder to GRID per user, therefore to share multiple folders with a single user, place all the folders inside one parent folder. Use the parent folder as the location on GRID in the ticket.
Q: I want to share my data and don't have a specific user in mind, can I share it to the public?
A: Yes, but not with the sftp server. Please submit a ticket for creating a labshare.
Q: I have another question
A: Please submit a ticket.