Operations 5 min read

Quick Guide to Setting Up FTP Virtual Users on CentOS

Learn how to swiftly create and configure FTP virtual users on a CentOS 6.5 system using vsftpd, covering installation, configuration files, PAM authentication, ACL permissions, and service startup, with step-by-step commands and essential tips for Linux administrators.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Quick Guide to Setting Up FTP Virtual Users on CentOS

Overview

FTP is a mainstream file transfer protocol that plays an important role in Linux system management. This article introduces how to quickly create FTP virtual users to help Linux operations beginners get started.

Test Environment

Virtual machine software: VMware Workstation 12.5

Operating system: CentOS 6.5 x86_64

VM configuration: 4 vCPU, 512 MB RAM, 8 GB system disk, 6 GB data disk, 2 network adapters (NAT + Host‑only)

Procedure

Install vsftpd: yum -y install vsftpd Edit configuration file:

Enter configuration directory: cd /etc/vsftpd/ Edit vsftpd.conf with vim and add:

# Enable virtual user access
guests_enable=YES
# Set virtual user system account to ftp
guests_username=ftp
# Set virtual user config directory
user_config_dir=/etc/vsftpd/vir_user_conf

Create virtual user list: vim /etc/vsftpd/vir_user_ftp and add:

test
123456

Generate password database:

db_load -T -t hash -f /etc/vsftpd/vir_user_ftp /etc/vsftpd/vir_user_ftp.db
chmod 600 /etc/vsftpd/vir_user_ftp.db

Create virtual user configuration directory and file:

mkdir /etc/vsftpd/vir_user_conf
cd /etc/vsftpd/vir_user_conf
touch test

Edit PAM module authentication file: vim /etc/pam.d/vsftpd and add:

auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/vir_user_ftp
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/vir_user_ftp

Configure virtual user settings:

cd /etc/vsftpd/vir_user_conf
vim test

and add:

local_root=/var/ftp/pub/test
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
anon_world_readable_only=YES

Create the virtual user root directory:

cd /var/ftp/pub/
mkdir test

Set ACL access control: setfacl -R -m u:ftp:rwx test Start the FTP service and adjust security settings:

service vsftpd start
service iptables stop
setenforce 0

Key steps: configure vsftpd for virtual users, set access controls, create the virtual user database and root directory, disable firewall and SELinux, start the service, and test.

Notes: virtual users do not require a chroot because ftp defaults to restricting users to their home directories; ACL provides flexible permission control; you can bind‑mount additional directories (e.g., mount --bind /home/ hello) and grant ACL rights to the virtual user; if the FTP root is on a mounted disk, ensure the mount options include acl to allow ACL management.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ACLCentOSFTPVirtual Usersvsftpd
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.