Enhanced

Enhanced

Article from Issue 209/2018
Author(s):

LFTP is an alternative to the FTP command set, which supports many protocols and offers countless parameters.

Although pretty much outdated, the File Transfer Protocol (FTP) still plays a significant role. For 20 years, LFTP has offered a greatly expanded command set for the command line that handles secure transmissions, without being excessively difficult to handle.

FTP dates back to 1985. Designed for transferring files between two computers, FTP is a relic from the infancy of modern IT. Today it has lost much of its former importance, not least because of some serious security problems: It neither encrypts the FTP username and password, nor protects the data against manipulation during transfer.

FTP via SSL (FTPS) or SSH (SFTP) counteracts these weaknesses. The two methods are considered to be equally secure, and they encrypt both data and metadata during transmission. In most cases, SFTP proves to be more flexible and much simpler in practice.

Alternatives

FTP alternatives have been around for a long time – on Linux, the venerable secure copy (scp) has been used to transfer data to other machines from the command line. In the meantime, WebDAV (Web Distributed Authoring and Versioning), a kind of extension of HTTP with new commands, has also developed into a useful replacement.

Nevertheless, FTP is a marathon runner for various reasons, most often because many web hosts only offer FTP and leave WebDAV or SSH out of the equation. FTP is thus likely to be around for a while.

LFTP is a very powerful extension of the original FTP command set that has been under development since 1997. It is developed by Alexander Lukyanov, is licensed under the GNU Public License (GPL), and was last updated to version 4.8.0 in July 2017 [1]. LFTP supports a wide range of protocols, including plain vanilla FTP, along with FTPS, SFTP, HTTP, HTTPS, HFTP, FXP (see the "FXP" box), Fish, and BitTorrent.

FXP

FXP, which stands for File Exchange Protocol, is a method defined in FTP, but not named there, for controlling file transfers between two servers on a client. The files move directly from server to server, saving time. Many current FTP clients support FXP.

Special Features

LFTP stands out from most other command-line FTP clients with advanced features such as recursive mirroring and the ability to update entire directory trees and manage bookmarks. Several simultaneous sessions to different servers are implemented by assigning commands to slots in a separate shell. Additionally, scheduled transfers can be queued and scheduled, and bandwidth use can be managed. If a transmission breaks down, LFTP resumes it later on at the same location. If you exit LFTP, it continues to process the active tasks in the background.

Client-Server Model

LFTP can be found in the repositories of most distributions; thus, you can usually install it with the package manager.

To test LFTP without an active server, it is best to install an FTP server on a second local machine, to which LFTP then establishes a connection. For example, the very secure FTP daemon (vsftpd) [2] is a good way to go, because it does not require any configuration for simple tests. Before you can start, all you have to do is remove the # comment sign in front of the #write_enable=YES line in /etc/vsftpd.conf.

Last but not least, create a directory on the client computer for the test and fill it with some data.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • SystemRescueCd

    The SystemRescueCd live system contains numerous tools that you can use to recover deleted files or a defective system.

  • Finnix 93.0 Fresh from Debian Testing

    Finnix, a LiveCD Linux distro for system administrators, is available in version 93.0.

  • Command Line: FTP and NcFTP

    FTP and NcFTP are both FTP clients for the command line. While FTP only has basic file transfer functionality, NcFTP has a whole bunch of additional features.

  • Command Line: Yafc

    The console-based yafc client gives users a convenient, simple, and interactive approach to exchanging data with ftp and SSH servers.

  • FileZilla

    High-performance GUI-based ftp clients for Linux are hard to find. The graphical FileZilla ftp client closes the gap.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News