Transferring Data with SFTP and SCP
Categories: Data Management, Data Transfer
Print this article
The SSH-based SCP and SFTP utilities can be used to transfer files to and from NCCS systems. Because these utilities can be slow, we recommend using them to transfer limited numbers of smaller files.
Both SCP and SFTP are available on all NCCS systems and should be a part of each user’s environment. For example, on a UNIX-based system, to transfer the file
oldfile from your local system to your
$HOME directory on OLCF systems as
newfile, you would use one of the following commands:
sftp email@example.com sftp> put oldfile newfile sftp> bye
scp ./oldfile firstname.lastname@example.org:~/newfile
userid is your given NCCS username.
Standard file transfer protocol (FTP) and remote copy (RCP) should not be used to transfer files to the NCCS high-performance computing (HPC) systems due to security concerns.
SCP works with NCCS systems only if your per-process initialization files produce no output. The means that files such as
.profile, etc. must not issue any commands that write to standard output. If you would like for this file to write to standard output for interactive sessions, you must edit the file so that it does so only for interactive sessions.
For sh-type shells such as
ksh use the following template:
TTY=$( /usr/bin/tty ) if [ $? = 0 ]; then /usr/bin/echo "interactive stuff goes here" fi
For c-shell-type shells such as
( /usr/bin/tty ) > /dev/null if ( $status == 0 ) then /usr/bin/echo "interactive stuff goes here" endif