FTP: lftp Client
Server Training - FTP Server

A nice text based client for FTP is lftp.  You will find that knowing how to use a text based client for FTP can be very useful.

Lesson 8 / Lesson 10

Connect to a site using this command and assuming it is anonymous FTP:
lftp <site>

You can use either the IP Address of the hostname of the server you are connecting to.  When you want to terminate the connection choose quit.
The default is to connect with user anonymous and password lftp@.

To specify credentials of a user:
lftp -u <user> <site>

All unecessary text from the server will be suppressed unless you turn on debugging. You do this with the d switch:
lftp -d -u <user> <site>

Here is an example of a user logging and then using the "ls" command to view contents of a directory.  In this process you will note that it looks as if tom is logged in but in reality until you use a command or transfer a file lftp will not log in.  You can see that process when tom issues the command "ls" it logs him in and shows the content of his home directory.

lftp -d -u tom
lftp This e-mail address is being protected from spambots. You need JavaScript enabled to view it :~> ls
---- Connecting to ( port 21
<--- 220-Welcome to the secure FTP Server.  All actions are logged and reported.
<--- 220
---> FEAT
<--- 211-Features:               
<---  EPRT
<---  EPSV
<---  MDTM                       
<---  PASV
<---  SIZE
<---  TVFS
<--- 211 End
---> USER tom
<--- 331 Please specify the password.
<--- 230 Login successful.       
---> PWD
<--- 257 "/"                         
---> PASV
<--- 227 Entering Passive Mode (16,14,226,131,27,157)
---- Connecting data socket to ( port 7069
---- Data connection established       
---> LIST
<--- 150 Here comes the directory listing.
---- Got EOF on data connection
---- Closing data socket
<--- 226 Directory send OK.


Copyright CyberMontana Inc. and BeginLinux.com
All rights reserved. Cannot be reproduced without written permission. Box 1262 Trout Creek, MT 59874