How to setup FTP Server in Linux

FTP is a way to transfer files between two computers at different locations. It works over the OSI (Open System Interconnection) model of networking.

The FTP protocol uses port 20 or 21 to communicate between computers as a security concern between some organizations recommended changing the default port to some other port.

How to install OpenSSH server in Ubuntu

Today, we guide you on installing vsftpd (Subsystem on the top of SSH version 2 protocol), which claims to be the more secure version of FTP as its first 2 letters mention very secure.

Step 1: Installation VSFTPD in Linux

We will show you the installation of VSFTPD in all major Linux distribution. Before jumping into the install process, make sure you have sudo privileges for the account you are using to install.

Write or Copy-Paste the below command to your respective Linux distribution you are using in your system.


$ sudo apt install vsftpd -y

Red Hat/Fedora/SUSE

$ dnf -y install vsftpd


$ sudo pacman -Sy vsftpd

Step 2: Configuring FTP server

You can easily configure VSFTPD from configuration file located at /etc/vsftpd.conf. We suggest a few changes to make before starting your FTP server.

Disable anonymous login:

Make sure to turn off anonymous login from the configuration file to prevent unauthorized access to your system to anyone behind you.


Enable Changes to the FTP Server:

Set YES to write_enable to make changes on the server; otherwise, any changes made by the FTP cannot persist after the connection is closed.


Setting up Chroot

You can set a chroot environment to prevent users from changing their current home directory. To enable make a change like shown below in your configuration file.


Step 3: Restart your FTP Server

The final step, restart your FTP server to set changes properly.

$ sudo systemctl restart vsftpd

That’s how we install and setupVSFTPD Server in our Linux System. If you have an issue related to any above step, make sure to ask in the comment section.

Leave a Reply