For the complete documentation index, see llms.txt. This page is also available as Markdown.

36.4 vsftpd

vsftpd (Very Secure FTP Daemon) is designed with security as its primary goal and is widely used in Linux systems. Testing has shown that FTP client access from Windows environments does not produce garbled text.

Installing vsftpd

Install via pkg:

# pkg install vsftpd-ssl pam_pwdfile

Package descriptions:

Name
Description

vsftpd-ssl

vsftpd package with SSL support

pam_pwdfile

A PAM module that allows user authentication using a password file independent of system accounts (similar to the /etc/passwd format)

Tip

On FreeBSD systems, the /etc/passwd file is used only for compatibility; actual authentication uses the corresponding database file.

Install via Ports:

# cd /usr/ports/ftp/vsftpd/ && make install clean
# cd /usr/ports/security/pam_pwdfile/ && make install clean

Observe the installation output:

[2/2] Installing vsftpd-ssl-3.0.5_2...
===> Creating groups
Using existing group 'ftp'
===> Creating users
Creating user 'ftp' with uid '14'
===> Creating homedir(s)
[2/2] Extracting vsftpd-ssl-3.0.5_2: 100%

vsftpd creates the user ftp. View the UID, GID, and group information for the ftp user:

Creating Virtual Users

Add a new system user:

The following information has been created:

Item
Value

Username

ftptest

Password

z

Group

ftp

Configuring pam_pwdfile

Create the PAM configuration file /etc/pam.d/vsftpd:

Create the password database:

The above command adds user ftptest to the vsftpd login database and sets the password to z (for testing purposes only, this password is not secure!).

To add new users later:

Here, -6: forces the use of the SHA-512-based Crypt hash algorithm.

vsftpd Configuration File

The main configuration file for vsftpd is located at /usr/local/etc/vsftpd.conf, which can be modified directly; a backup template file is also provided at /usr/local/etc/vsftpd.conf.sample.

Modify the /usr/local/etc/vsftpd.conf file to the following content:

For the official documentation, see VSFTPD.CONF. For a Chinese translation, refer to Jin Buguo's vsftpd.conf Chinese version.

The vsftpd.chroot_list File

Create and edit the /usr/local/etc/vsftpd.chroot_list file, adding the user ftptest to it.

Creating Paths

Create the FTP directory and set permissions:

Service Management

After configuration is complete, start and manage the vsftpd service:

Log in to FTP with the username ftptest and the password z.

vsftpd log files are located at /var/log/vsftpd.log.

References

angeloma. How to set up vsftpd on FreeBSD 12?[EB/OL]. (2020-02-13)[2026-03-25]. https://www.osradar.com/how-to-set-up-vsftpd-on-freebsd-12/. Steps for installing and configuring vsftpd on FreeBSD.

Last updated