How to setup FTP Server in Linux

  • Post last modified:April 27, 2021
  • Reading time:2 mins read

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.

Debian/Ubuntu

$ sudo apt install vsftpd -y

Red Hat/Fedora/SUSE

$ dnf -y install vsftpd

Arch/Manjaro

$ 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.

anonymous_enable=NO

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.

write_enable=YES

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.

chroot_local_user=YES
chroot_list_file=/etc/vsftpd.chroot_list

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.

Like what you read? Please share it with others.
  • 1
    Share
guest
0 Comments
Inline Feedbacks
View all comments