T
Techeia
Back to Blog

How to install FTP server in linux

October 7, 2014
By Ajesh AV
How to install FTP server in linux

Mastering `vsftpd`: Your Go-To Guide for Linux FTP

FTP, while often seen as a legacy protocol, remains an indispensable tool for many system administrators and developers. When you need a reliable, secure, and straightforward FTP server on Linux, `vsftpd` (Very Secure FTP Daemon) is the undisputed champion. I'm Ajesh AV, and at Techeia, we believe in getting straight to the point. Let’s get `vsftpd` configured and running.

Installing `vsftpd`

Getting `vsftpd` onto your system is typically a one-liner, regardless of your distribution. Pick the command relevant to your Linux flavor:

  • Alpine Linux (apk): apk add vsftpd
  • Ubuntu/Debian (apt): sudo apt install vsftpd
  • Red Hat/CentOS/Fedora (rpm/dnf): sudo dnf install vsftpd (or `sudo yum install vsftpd` for older systems)

Configuring Your FTP Server

The heart of your `vsftpd` setup lies within its configuration file: /etc/vsftpd/vsftpd.conf. Open it with your preferred text editor (I'll use `vi` here):

vi /etc/vsftpd/vsftpd.conf

Now, let's enable and understand some essential parameters:

Enabling Local User Login

To allow users defined in your system's /etc/passwd (i.e., your standard Linux users) to log in with their credentials, ensure this line is uncommented:

local_enable=YES

This is crucial for secure, authenticated access.

Granting Write Access

If your users need to upload, create, or modify files on the FTP server, you must enable write access:

write_enable=YES

Without this, FTP will be read-only.

Allowing Anonymous FTP (Use with Caution!)

Anonymous FTP access allows anyone to connect without a username or password. While convenient for public downloads, it's a significant security risk if not properly restricted. Enable it only if you fully understand the implications:

anonymous_enable=YES

Applying Configuration Changes

After making any changes to vsftpd.conf, you must restart the `vsftpd` service for them to take effect:

/etc/init.d/vsftpd restart

On newer `systemd`-based systems, you might use:

sudo systemctl restart vsftpd

Troubleshooting: The "500 OOPS: child died" Error

Encountering "500 OOPS: child died" is a common headache, especially with `vsftpd` version 3.0.2. This often relates to `seccomp` sandbox issues. The fix is straightforward:

Add the following line to your /etc/vsftpd/vsftpd.conf file:

seccomp_sandbox=NO

After adding this, remember to restart the `vsftpd` service, and your server should be back online.

With these steps, you should have a functional `vsftpd` server ready to handle your file transfer needs. Happy transferring!

Related Topics

MAIN_LAYOUT_ACTIVE_MARKER
LAYOUT_ACTIVE_MARKER