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
" instead of "machinename
ftp
". After that, things go
pretty much the same as in machinename
ftp
.
There are just a few differences to be aware of:
You need an sftp client program on your local machine instead of just an ftp client program. See the Library page for suggestions.
Instead of connecting to a machine that runs an ftp service
(e.g., ftp.cs.odu.edu
), you connect to an ssh
server.
There is no equivalent to the ftp anonymous login.
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.
If either file is on your local machine, you omit the
"loginName
@machine
:"
part. For local files, you may use relative paths to specify the
file name. For remote files, you should use absolute paths.
If your login name on your local machine is identical to your
login name on the remote machine, you can omit the
"loginName
@" part.
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.