Close menu Resources for... William & Mary
W&M menu close William & Mary

Transferring files from HPC using sftp/scp

For Linux, Mac, and Windows (PowerShell) an sftp session or scp command to an HPC front-end host can be done easily from on-campus (main or VIMS) or off-campus through the bastion host. In the following examples we will connect to comet.sciclone.wm.edu to download files from our home directory because it hosts the user home directories on the main-campus cluster. See here to know which cluster front end to connect to for the filesystem you need files from.

sftp

sftp1.png

In the example above we open an sftp session to download a file and upload an updated version. First we use the "stfp" command along with our WM username plus the cluster front end we want to exchange files with. Next we use 'ls' to list the files inside of the remote directory. Next, we download the file 'run' with the command 'get run'. Finally, we upload an updated version of 'run' with the command 'put run'. More information about sftp and the options available can be found on the manual page located here.

scp

sftp2.png

We can also use single line scp commands to download and upload files to the cluster as seen in the example above. In the first command, we pull the file "run2" from comet to our local computer in the current directory. Next, we push the "run" file from our local computer to the comet cluster at our home directory. More information about scp and the options available can be found on the manual page located here.

off campus

To create an sftp/scp session to an HPC cluster remote host through the bastion host simply add -J <username>@bastion.wm.edu to your command line between the command and the front end you are accessing. The connection will be DUO authenticated before a connection can occur. Once connected, the session is the same as if the user is on-campus.

sftp3.png