mr_evans2u has asked for the wisdom of the Perl Monks concerning the following question:

I have a perl/cgi site that uses ftp to get and put files from one server to another. The company has been talking about shutting down ftp, is there a good secure alternative to ftp that wouldn't cause a major rewrite? I know there are command line alternatives but everything on the site is down behind the scenes.

Replies are listed 'Best First'.
Re: alternative to ftp
by waswas-fng (Curate) on Dec 09, 2003 at 19:36 UTC
Re: alternative to ftp
by TomDLux (Vicar) on Dec 09, 2003 at 19:38 UTC

    You want scp, the ssh replacement for rcp ( remote copy ).

    You can configure it to not require passwords, by storing encrypted keys for each connecting site. Configuration is a minor pain, but you only have to do it once.

    Use the -r flag to do recurse copies of entire directory hierarchies.

    --
    TTTATCGGTCGTTATATAGATGTTTGCA

      If you're copying hierarchies, a much better way to do it is with rsync. It will skip over unchanged files and transfer only the deltas of changed files, which makes it very efficient.

      It uses port 873 by default. Otherwise you can arrange to use ssh as an underlying transport. What you gain in security, you lose in raw transfer rates (especially on Solaris, where you have to use egd as an entropy source, this can take a significant chunk of CPU).

      It also handles interrupted transfers very well. Just restart it and away it goes. Be sure to install the latest tarball; there was a security breach reported a few weeks ago.

      It has a slab of command-line switches, but all you really need to know is -aqz (and possibly --delete if you want a delete of a source file to result in the delete of the target file).

      I and others have put a lot of work into the SSH Keys and the SSH Notes pages at the WLUG Wiki; all the instructions you're ever likely to need are there, and then some.

      Makeshifts last the longest.