1.4. Secure File Transfer: sftp and scp

FTP is one of the older services on the internet. It works, but has some limitations. Some people may encounter issues using it from systems behind very aggressive firewalls. It also is not very secure. Not only is everything you transfer sent in a plain, unencoded format, but even your login name and password are sent in plain-text.

SFTP (Secure File Transfer Protocol) is a more modern variant that encodes your entire session. It is built upon the secure ssh service, and therefore shares ssh's ability to tunnel out through most reasonablly configured firewalls. And, if you know how to use ftp, then you pretty much know how to use sftp as well. Just give the command "sftp machinename " instead of "ftp machinename ". After that, things go pretty much the same as in ftp.

There are just a few differences to be aware of:

As a general rule, I tend to use sftp instead of ftp unless I need to access a pool of anonymous ftp files.

Another secure alternative to ftp is scp, which you can think of as an attempt to extend the normal Unix cp command to work across networks. The basic format of an scp command is

scp loginName1
@machine1
:file1
 loginName2
@machine2
:file2


to copy a file from one machine to another.

For example, from my home Linux machine, if I wanted to grab a copy of my .emacs file from my home directory on atria.cs.odu.edu, I might say:

scp zeil@atria.cs.odu.edu:/home/zeil/.emacs myAtria.emacs

Personally, I seldom use command-line scp because the paths on the remote machine tend to get long and, unlike paths on your local machine, you cannot use the Tab-key to complete file and directory names after typing the first few characters. I generally use sftp instead. Many command-line sftp clients do tab completion on the remote files. Even if they do not, the built-in ls command to list the current directory o nthe remote machine makes it easy to copy-and-paste long file names.

Of course, just as with ftp, you can also eschew the command-line entirely and get a graphical scp/sftp client that lests you transfer files by dragging them between local and remote windows. See the Library page for suggestions.