In this article, we will have explained the necessary steps to install FTP Server on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
FTP or File Transfer Protocol is a protocol for transferring files between computers on the internet over TCP/IP connections. The FTP was designed for client-server architecture, all files stored at the server accessible through FTP clients.
Install FTP Server on Ubuntu 20.04
Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.
sudo apt update sudo apt upgrade
Step 2. Installing FTP Server on Ubuntu system.
To install FTP Server on Ubuntu, run the commands below:
sudo apt install vsftpd
Once the installation is complete, start the vsftpd service and add it to the system boot:
sudo systemctl start vsftpd sudo systemctl enable vsftpd
Step 3. Setup New User.
We will add a new user for the vsftpd server and add the FTP directory:
Type the password for your user and you’ve added a new user.
Next, create a new FTP directory under on the ‘/home/username’ directory:
mkdir -p /home/meilana/ftp
Change the ownership of the FTP directory:
chown -R nobody:nogroup /home/meilana/ftp chmod a-w /home/meilana/ftp
Step 4. Configuring vsftpd.
We’re going to create a brand new configuration file. Before we do that, let’s rename the original with the command:
sudo mv /etc/vsftpd.conf /etc/vsftpd.conf.orig
Create the new file with the command:
listen=NO listen_ipv6=YES anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES use_localtime=YES xferlog_enable=YES connect_from_port_20=YES chroot_local_user=YES secure_chroot_dir=/var/run/vsftpd/empty pam_service_name=vsftpd rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key ssl_enable=NO pasv_enable=Yes pasv_min_port=30000 pasv_max_port=30100 allow_writeable_chroot=YES
Step 5. Testing the FTP server on Ubuntu 20.04.
One way is to open a terminal and try to access it with the
ftp command and the server’s IP address:
Once the connection to the server is established, you will be asked for the username and password.
That’s all you need to do to install FTP Server on Ubuntu 20.04 LTS Focal Fossa. I hope you find this quick tip helpful. Don’t forget to share your valuable queries/suggestions in the below comment box & also drop your worthwhile feedback.