VSFTPD (Very Secure FTP Daemon) is a secure, lightweight, and stable FTP server used widely across Linux systems. It supports IPv6, TLS/SSL encryption, and is the default FTP server on several major distributions.
This guide covers the installation and configuration of VSFTPD on:
- RHEL-based distributions (CentOS, RHEL, AlmaLinux, Rocky, Oracle)
- Debian-based distributions (Ubuntu 18.04, 20.04, 22.04+)
Step 1: Update the System
# sudo dnf update -y (For RHEL 8/9, AlmaLinux, Rocky, Oracle) # sudo yum update -y (For CentOS 7) # sudo apt update && sudo apt upgrade -y (For Ubuntu)
Step 2: Install VSFTPD
# sudo dnf install vsftpd -y (For RHEL 8/9, AlmaLinux, Rocky, Oracle) # sudo yum install vsftpd -y (For CentOS 7) # sudo apt install vsftpd -y (For Ubuntu)
Step 3: Configure VSFTPD
Open the configuration file:
# sudo nano /etc/vsftpd.conf
Modify or add these lines:
anonymous_enable=NO local_enable=YES write_enable=YES chroot_local_user=YES
Save and exit (CTRL+O, Enter, then CTRL+X).
Step 4: Enable and Start the Service
# sudo systemctl enable vsftpd # sudo systemctl start vsftpd
Step 5: Allow FTP Port in Firewall (If Active)
RHEL-based (firewalld): # sudo firewall-cmd --permanent --add-port=21/tcp # sudo firewall-cmd --reload
Ubuntu (UFW): # sudo ufw allow 21/tcp # sudo ufw reload
Step 6: Create an FTP User
# sudo adduser demovps # sudo passwd demovps
Step 7: Add User to Allowed List (Optional)
Only needed if userlist_enable=YES is set in your config:
# echo "demovps" | sudo tee -a /etc/vsftpd.user_list
Then ensure these lines are in vsftpd.conf:
userlist_enable=YES userlist_file=/etc/vsftpd.user_list userlist_deny=NO
Step 8: Set Correct Permissions for User Folder
# sudo chmod 750 /home/demovps/ # sudo chown -R demovps: /home/demovps/
Step 9: Final Verification
Test FTP access:
# ftp your-server-ip
Or use an FTP client like FileZilla.