Disclaimer: The process in this article may seem complicated and slow, but it is designed for you to learn the basics first. The final section of the article is dedicated to making things easier and faster for everyday use. So, please don’t give up early.
lftp, OpenSSH, and OpenSSLfrom the Net category in Cygwin
Install lftp with your package manager, something like:
sudo apt-get install lftp
Note: lftp is installed on your Whatbox slot by default. You can use it to transfer between your slot and other ftp servers (e.g. another seedbox). Just connect to your slot using SSH and use it as normal.
Connecting to Whatbox
Open your terminal (Cygwin Terminal for Windows users). You will see a window that looks similar to below.
Start lftp and connect to Whatbox. Type
lftp sftp://[email protected]. Enter your password at the prompt. lftp keeps your password hidden, so it’s easiest to paste with the right-click menu.
lsin the terminal to show a listing of your home directory. Since most users will want to start in their files directory, type
cd filesto navigate there for the next step.
(optional) If you want your password to be saved when you create a bookmark, use the command
set bmk:save-passwords truenow.
bookmark add Whatboxwill save a bookmark to your slot named Whatbox. You can use
bookmark listto make sure it saved properly. This allows you to use
lftp Whatboxto open a connection to your slot instead of having to type out the address.
Local and Remote Navigation
Note: I have set up directories and files for demonstration. You can set things up like I have for practice, if you like, or replace them in the commands with your own.
cdto go down one level into a directory. You can use
cd ..to go up one level. Type
lsto see that you’re back in your home directory.
Next, you’ll use
cdto navigate directly to a directory more than one level away.
cd ~/files/Videobrings me into the directory I set up.
Now to navigate to directories on your computer with the
lcd(read: local cd) command. The directory structure will be different on Linux than with Cygwin. On Linux, simply type
lcd /path/to/directory. With Cygwin, if you want C:Download you would type
lcd /cygdrive/c/Download. To list what’s in the current local directory, add an exclamation point to the
There are two main commands used for downloading:
pgetfor files and
There are two main commands used for uploading:
putfor files and
mirror -Rfor directories.
To cancel a transfer, use
To resume partially downloaded files/directories, you will use the -c switch:
mirror -c Directory
pget -c Video1.mp4
put -c Video1.mp4
Note: This guide uses 5 segments as an example. You may use as many as needed or desired.
pgetcommand using segmentation is
pget -n 5 Video2.mp4, where 5 is the number of segments.
mirrorcommand using segmentation is
mirror --use-pget-n=5 Directory, where 5 is the number of segments.
You can use
jobs -vto see the speeds of the individual segments as well as the total speed.
Queues and Jobs
queuecommand will allow you to transfer files/directories while still being able to browse. The basic command to queue a file transfer will look like
queue pget Video1.mp4. To transfer entire directories,
queue mirror Directory. This adds them to your transfer queue and automatically starts the transfer if ready.
queuealone to display your transfer queue. The
jobscommand displays your current transfers and transfer queue with more detail.
You can stop your queue from automatically transferring by using
queue stop. This can be used before adding anything to your queue to prevent immediate transfer.
queue startwill start your queued transfers. To delete a transfer from your queue, add the -d switch like
queue -d #, where # is the queue number listed by
To stop and delete a running transfer, use the
killcommand. If you set lftp to allow multiple transfers simultaneously,
kill #, where # is the number listed by
jobs, will stop and delete the specified transfer.
kill allwill stop and delete all transfers.
Configuration and Aliases
Now to make it quick and easy, we’ll set up some aliases. Aliases allow you to make shortcuts to commands.
- In Linux, find your lftp.conf file. It should be in /etc.
- In Windows, open the etc directory where you installed Cygwin (C:Cygwin by default) and open lftp.conf.
- Go to the end of the file and add some or all of these example aliases. Modify them to fit your needs.
Some examples from this guide with those aliases applied:
queue pget -cn 5 Video1.mp4becomes
q p Video1.mp4
queue mirror -c --use-pget-n=5 Directorybecomes
q m Directory
For full command help and settings, see the lftp man page.
Tips and Tricks
- The Tab key autocompletes file and directory names. It also autocompletes commands.
- Files and directories with spaces or special characters need special handling. The easiest method is to put quotes around the file/directory names.
- You can cycle through peviously used commands with the Up and Down arrow keys.
- To quit lftp, type
exit. Then type
exitagain to close the terminal.