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

            % sftp my_login@server.organization.org
            Connected to server.organization.org.
            sftp> mkdir pdfs
            sftp> put *.pdf pdfs
            Uploading foo.pdf to /home/fs01/wbt3/pdfs/foo.pdf
            foo.pdf                                                          100% 8165     3.6MB/s   00:00
            Uploading rgbplot.pdf to /home/fs01/wbt3/pdfs/rgbplot.pdf
            rgbplot.pdf                                                      100%  420KB  36.7MB/s   00:00
            Uploading subplots.pdf to /home/fs01/wbt3/pdfs/subplots.pdf
            subplots.pdf                                                     100%   12KB   4.2MB/s   00:00
            sftp> cd pdfs
            sftp> ls
            foo.pdf                  rgbplot.pdf              subplots.pdf
            sftp> quit
        
A terminal session showing an sftp session with several commands and their output.

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.

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement