Enhanced
Which LFTP?
If you want to use LFTP with FTPS, you might need to compile the package with SSL support yourself. Use the command line to check whether this is necessary by entering the
which lftp
command to determine where LFTP has been installed. After calling
ldd /<path>/<to>/lftp
check its output to see whether one of the lines starts with libssl (Figure 1); for example:
$ ldd /usr/local/bin/lftp | grep ssl
If this is not the case, and you want to use FTPS instead of SFTP, follow the instructions in the "DIY LFTP" box.
DIY LFTP
On Debian, you need to install the following dependencies:
- libgnutls30
- libgcc1
- libreadline-dev
- libssl-dev
- libtinfo5
- libunwind8
- libghc-zlib-dev
Depending on the version of the system you are using, you might need other versions of these packages. If further software is missing, entering ./configure
will usually let you know. Build LFTP as shown below with the usual three-card trick – ./configure
, make
, and make install
– and use ldd
to test your home-grown LFTP version for SSL support.
$ wget http://lftp.yar.ru/ftp/lftp-4.8.0.tar.gz$ tar xfz lftp-4.8.0.tar.gz $ cd lftp-4.8.0 $ ./configure --with-openssl=/usr/lib $ make $ sudo make install $ ldd /usr/local/bin/lftp | grep ssl libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fbe89dbd000)
At system startup, LFTP will search the /etc/lftp.conf
, ~/.lftprc
, and ~/.lftp/rc
files (in that order) for configuration. Directives that you create in the home directory take precedence over the global configuration in the /etc
directory. The instructions always start with set
and follow the
set <Option>:<Switch>[on|off]
scheme.
Practice
For test purposes, it is best to use two local computers that serve as the server and client. LFTP will behave in the same way as if you were using remote servers, but it will be easier to locate sources of problems and errors. Unless you specify otherwise, LFTP uses the SFTP protocol. Ports other than standard port 21 are entered at the end of the connection command in the form :<port>
.
For more feedback, add the -d
(debug information) option to the lftp
call. The -h
(--help
) parameter offers little help when it comes to the application's options. An intelligible version of the LFTP man page can be found on the Lifewire website [3].
To get used to the LFTP shell, first download or upload files from the server. To do this, log on to the server with the lftp <user>@[<FQDN>|<IP>]
command; for example:
lftp ft@192.168.178.123
After the connection is established, you are in the LFTP shell.
The ls
command lists the current directory content on the server. With a preceding exclamation mark (!
), you can redirect the command to the client; !ls
shows the contents of the client's current local working directory (Figure 2). Some commands can be executed with a preceding small l
(ell, for "local") on the client, and other commands can be preceded by either switch. Usage is not completely consistent. To simplify things, you can define command aliases to suit your own requirements.
Up and Down
To upload a file from the client to the server, use the put
command, to which you add the name of the file in question (put <file>
). The -d
parameter used for logging in shows you what is happening in the background in detail. If you want to put the file in a certain directory, go there with the cd
command and then run put
.
Following the same pattern, get
lets you download a file. However, with pget
, LFTP offers an alternative that distributes the data transfer over several parallel connections, thus speeding up the download on servers with slow connections. In practice, you would first change to the directory in which you want to store the downloaded file !cd
or lcd
followed by get <file>
or pget <file>
.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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.
News
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4