Home Tutorials How To Install LFTP To Download and Upload Files in Linux

How To Install LFTP To Download and Upload Files in Linux

The LFPT is a command-line-based file transfer protocol server that is widely used on Linux servers and desktop environments for sharing files and managing server automation. After you install LFTP in Linux, you can use the basic FTP, HTTP, HTTPS, SFTP, and other proxy server works. It also allows users to upload files in a segmented method.

The LFTP tools can be used for both uploading and downloading files on the local server. If you’re a professional or power server admin, installing and using the LFTP tool on Linux might help you in partial updating, running queries, limiting bandwidth for uploading files, and many more operations.

Install LFTP in Linux System


Using the LFPT server is beneficial for server administrators for many reasons. In Linux, you can use cache loading, visit server statistics, send pending files to the server through server flush, and many more. After installing the LFTP tool on Linux, you can set the uploading limit, memory usage limit and set chmod rules to make the server more efficient.

Good programmers would love the feature to run an argument as a command and, with other flags, convert an argument into a new command. The LFPT server is built mostly for Linux and UNIX-like machines for synchronizing files into the server. In this post, we will see how to install and run the LFPT server on a Linux machine.

Step 1: Install LFPT on Linux


Using the LFPT client tool on a Linux machine is pretty easy and straightforward. To install the LFTP server on a Linux machine, you will need the basic knowledge of terminal shell, an active internet connection, and the root privileges to the machine. Please make sure that your system repository is up to date.

Since the LFPT is a widely used tool, it is already available on the official Linux repository, and you can install it on your machine through the official package installer command. Please execute the appropriate command for your Linux machine from the commands lists given below to install LFTP.

Install LFPT tool on Ubuntu/Debian Linux

$ sudo apt-get install lftp

install LFTP on Linux

Get the LFPT Tool on Fedora/Red Hat Linux

$ sudo yum install lftp

Install LFPT on Arch-based Linux systems

$ sudo pacman -S lftp

Install LFPT on SuSE Linux

$ sudo zypper install lftp

After installing the LFPT tool, please go through the manuals to get ideas about how the syntaxes work for the LFTP on Linux.

$ man lftp

Step 2: Get Started with LFPT on Linux


After we install the LFTP server client on our Linux system, we can now generate an RSA key to access the server in a secure way. Later we will use the ssh key for accessing the LFTP server.

Execute the following command on the terminal shell to get the RSA key.

$ sudo ssh-keygen -t rsa

Now, run the command with your server IP for getting access.

$ sudo ssh-copy-id ubuntupit@serverIP
$ sudo ssh ubuntupit@serverIP

If we already have a server set and a configured server, we can lunch it through the LFTP commands given below.

lftp ftp://user@host
lftp ftp://ubuntupit@localhost

Step 3: Upload and Download Files Via LFTP on Linux


With proper syntax, commands, and rules, you can access the server from your Linux machine. The following commands will help you to understand how to access the server from the CLI. Numerous users consider the below-given commands as the must-use commands after installing the LFTP on Linux.

$ lftp sftp://your_username@your_hostname/host_IP_address
$ lftp sftp://your_username@your_hostname/host_IP_adress:port_number
$ sudo lftp sftp://ubuntupit@localhost:port

After you access the server, you can run the ls command to see the files and directories.

$ ls

The following command will upload a file on the server from your Linux machine.

put name_of_file_to_send

Next, execute the below-mentioned commands to mark the file and upload it through the lpwd command.

> lpwd
> put print.pdf

In the same way, we uploaded a file, and we can also download files from the server from the LFPT server client tool on Linux.

$ pget name_of_file_to_download
> pget ubuntupitNewfile.txt

If you face issues while uploading and downloading files from the server via the LFTP tool on Linux, you can use the following commands to resume the action.

pget -c ixnfo.txt
put -c ixnfo.txt

The following commands would also upload and download files on the server through the LFTP server tool. The pget command will download and the put command will upload files on the server.

pget localhost.txt
put localhost.txt

In advanced-level work, the following mirror command will allow you to get the entire directory from the server. 

mirror remote ubuntuPIT_local_dir

Among other available GUI and CLI FTP servers that are available and hassle-free to use, the LFPT is one of the best server tools. If you face an issue installing LFTP in Linux and accessing the LFTP server from your Linux machine, make sure that the UFW or other firewall tools are allowing your FTP in the network.

Final Words


The most popular feature of having an FTP server would be sharing files with local users through home Wifi or LAN. Well, the FTP server also has that feature where you can upload your files, movies, and documents to the server and access them from both Linux and Windows machines. It also allows synchronizing files to a remote server through the Linux shell commands. In the entire post, we have seen the methods of how to install LFTP in Linux.

Please share it with your friends and the Linux community if you find this post useful and informative. You can also write down your opinions regarding this post in the comment section.

NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here


Exit mobile version