Or copy link
Copy link
File Transfer Protocol (FTP) refers to a network standard that allows the transmission computer files from a computer client to a server over a network, or vice versa. Its structure is built on the client-server framework and it uses separate control and data channels for communication between the client and the server. For distributing files to remote users, backing up files, or sending large files over a network, FTP servers are most commonly used. Ubuntu is a popular distribution of Linux that is used both by desktop and laptop users and on servers and cloud systems.
The goal of this post is to detail installing an FTP server on Ubuntu OS. There are many software packages that can be used but in the following section I will describe installing FTP server on Ubuntu using the popular vsftp server software.
Before proceeding with the installation, ensure that your Ubuntu system is up to date and has all the necessary packages installed. Run the following commands to update and upgrade your system:
sudo apt update && sudo apt upgrade -Y
Installing vsftpd
vsftpd, (or very secure FTP daemon) is an FTP server for Unix systems, which include Linux distribution. It is the default FTP package server in Ubuntu, CentOS, and Red Hat Enterprise Linux. Install vsftpd using the following command:
sudo apt install vsftpd
Configuring vsftpd
The main configuration file for vsftpd is located at /etc/vsftpd.conf. Open the file using a text editor like nano or vi:
sudo nano /etc/vsftpd.conf
Before changing anything in the configuration file, let’s discuss some of the important configuration options:
Now you understand the options. Make the following changes to the configuration file:
anonymous_enable=NO local_enable=YES write_enable=YES chroot_local_user=YES allow_anon_rwx=NO
These changes disable anonymous FTP access, enable local user access, allow writing to the FTP server, force local users to chroot to their home directories, and disallow anonymous users to read, write, or execute files.
Embrace FTP On Our Ubuntu VPS Today!
Unleash the power of Ubuntu with high-performance VPS hosting plans. Equip Ubuntu VPS with FTP and experience the power of secure, efficient file transfers.
After installing the FTP Server in Ubuntu we have to create a user before accessing the FTP server. The simplest way to do this is to use the adduser command. For example, to create an FTP user named ftpuser, run the following command in your terminal:
sudo useradd -r -s /bin/false -d /home/ftpuser ftpuser
This command creates a user named ftpuser with a home directory of /home/ftpuser and sets the user’s shell to /bin/false, preventing direct login to the FTP server using the ftpuser account.
Setting User Permissions
Set the appropriate permissions for the FTP user’s home directory:
sudo chown -R ftpuser:ftpuser /home/ftpuser
This command changes the ownership of the /home/ftpuser directory and its contents to the ftpuser user and group.
Allowing FTP Traffic Through the Firewall
If you are using a firewall, you must allow FTP traffic to pass through. In Ubuntu, you can use the UFW firewall management tool. Run the following commands to allow FTP traffic:
sudo ufw allow 21/tcp sudo ufw allow 20/tcp sudo ufw enable
These commands allow FTP traffic on ports 21 (for data connections) and 20 (for control connections) and enable the UFW firewall.
Restarting vsftpd
After making changes to the configuration file, you need to restart vsftpd for the changes to take effect. Run the following command in your terminal:
sudo systemctl restart vsftpd
You can test your FTP connection using an FTP client such as FileZilla. To connect to your FTP server by configuring FileZilla, follow these steps:
If the connection is successful, you will see a list of files and directories on your FTP server in the File Listing panel.
In conclusion, installing an FTP server in Ubuntu is a straightforward process that can be completed in a few steps. By following the instructions provided in this article, you can easily set up an FTP server that you can use to transfer files between computers. However, it is important to note that FTP is an unencrypted protocol, which means that data transferred using FTP can be intercepted and read by third parties.
Establishing an FTP server on Ubuntu empowers you to seamlessly exchange files between your local device and the remote server. Ultahost comes with reliable and affordable VPS hosting plans. We offer a wide variety of plans to suit your needs, all at quality prices which include VPS full root access with SSD NVMe drive supported.
Docker has revolutionized how we build, deploy, and run...
File handling is a day-to-day task of Linux users and a...
tr is a text manipulation command in Linux/Unix that is...
Kali Linux is a powerful and versatile operating system...
As a favorite among novice and intermediate developers,...
Composed of multiple Operating Systems built on the Lin...
Save my name, email, and website in this browser for the next time I comment.
Δ