SFTP - Secure File Transfer Protocol
SFTP (secure file transfer program) is another good protocol for transferring smaller amounts of data (<= 100 GB). It provides the interactive functionality of FTP, but like SCP it uses SSH to communicate with remote systems. This gives you both powerful functionality and secure transmission of your encoded credentials and data. However, these benefits come at the price of SFTP often being significantly slower than SCP and FTP.
The following example shows an SFTP session using the sftp
command line utility
(openbsd.org man page).
- A connection is opened from the local system to "server.organization.org" (specified on the command line)
- A new folder "pdfs" is created
- Some PDF files are copied
- The current remote directory is changed
- The folder contents are listed
- The SFTP session is ended
Some versions of SFTP (including that from OpenSSH)
have the additional ability to resume data transfers that were interrupted.
You can do this by specifying the -a
option on the command line
or by using the reget
and reput
options in the program.
If the SFTP tool is not already installed on your system, you can install it yourself. There are also a number of excellent GUI clients that make it even easier to use SFTP.
Exercise
In order to perform this exercise, you must first generate the test data on your local computer. Use sftp to transfer each of the three files to Stampede2 or Frontera and note how long each transfer takes. The largest file, biggestfile.txt, is just a little over the 2 GB limit recommended for using sftp. Now use sftp to transfer these files back from Stampede2/Frontera to your local computer.