JOSHUA AQUINO

Home   Blog   |    

Question: What Kind of File Copying Protocol is Best?

False. Black bear.

What I Chose and Why

SCP is what I ended up choosing because it is...

  1. intuitive and simple
  2. easy to use from the command line
  3. pre-installed on most Linux distributions
  4. relatively small as a solution
  5. the first article I found when searching online

Send a file with SCP by typing the following:

scp /path/to/local-file.txt user@remoteserver.com:/path/to/destinationfolder/

Install SCP using the following command if it isn't already pre-installed (for Debian):

sudo apt-get install scp

WinSCP is also available for Windows operating systems, and also offers SFTP functionality among other things.But really, who cares!

Notes on Sending Remote Files

I selected between SCP, SFTP, and RSYNC; the default, native, or most ubiquitous implementations are being compared. So the pre-installed versions of SCP and SFTP, as well as the command line utility of rsync. No fancy clients or GUIs are being compared, mainly because the overlap of features is so great, that any good client can do the job of any other relatively well. Also, in many cases a desktop environment won't be available to someone transferring files to and from remote servers, so GUIs won't be of much use.

In all honesty, if copying files remotely is all you need, any of these solutions will work decently. It just depends on which one slides into your work flow more easily.

Also, if you want to send really big files, something like FileZilla or GridFTP is probably worth looking into. With some configuration, the three solutions mentioned in this post can deal with gigantic files, but natively none of them are really optimized to do that.

The Combatants

SFTP

Description

Presented more like a remote file system protocol than a "secure file transfer protocol," with a CLI and many GUIs to facilitate its usage. Capable of secure file transfer, along with file/directory creation, deletion, and renaming functionality. Pausing/resuming file transfer is useful for large files and spotty connections, though support of this function varies between clients.

Pros
  • secure protocol
  • versatile feature set for remote file management
  • transfer pausing benefits poor connections, large files, and corruption recovery
  • optional compression over transfer
Cons
  • a bit more clunky when invoked from the command line
  • additional functions can be seen as unnecessary for those that use other utilities for such purposes
Interesting Links

sftp security risks |how to use sftp

RSYNC

Description

A file synchronization tool that utilizes a delta algorithm to only transfer changes between two files. Relatively efficient with bandwidth, highly configurable, and an excellent solution if a directory should exist identically in two different machines.

Pros
  • only sending file differences makes it more efficient with large files
  • directory mirroring; not offered by SCP or SFTP
Cons
  • not as secure natively (can optionally send over SSH)
  • not as feature rich in terms of file management as SFTP, and not as simple as SCP
Interesting Links

rsync over ssh |schedule rsync with cron

SCP

Description

A simple and secure protocol that allows the copying of files from a local host to a remote one (and back if so inclined). Natively transferring over SSH, SCP comes pre-installed in most Linux distributions.

Pros
  • very simple
  • pre-installed on most Linux distributions
  • easily invoked from the command line
  • good for sending to servers if no desktop environment is available
Cons
  • very simple
  • the standard command is not feature rich or intuitive to those looking for a GUI (though GUI clients are available)
Interesting Links

scp security vulnerabilities |scp vs. sftp |scp and sftp arch linux