Using scp at NERSC¶
Secure Copy (scp) is used to securely transfer files between two hosts using the Secure Shell (ssh) protocol.
Scp is suggested for smaller files (<~10GB), otherwise use Globus.
To transfer files into/out of NERSC using scp, you need an ssh client. On Linux/Unix and MacOS these should be installed by default, but on Windows you will need a GUI tool such as WinSCP.
Get a file from Data Transfer Node
scp firstname.lastname@example.org:/remote/path/myfile.txt /local/path
Send a file to Data Transfer Node
scp /local/path/myfile.txt email@example.com:/remote/path
Use a pre-existing ssh key (like one made by sshproxy)
scp -i ~/.ssh/nersc firstname.lastname@example.org:/remote/path/myfile.txt /local/path
When you want to transfer many small files in a directory, we recommend Globus. If you don't wish to use Globus, you can consider using ssh piped with tar.
Send a directory to Data Transfer Node:
tar cz /loca/path/dirname | ssh email@example.com tar zxv -C /remote/path
Get a directory from Data Transfer Node:
ssh firstname.lastname@example.org tar cz /remote/path/dirname | tar zxv -C /local/path