Server ManagementIntermediate15 min
How to Set Up FTP Server with vsftpd
Configure secure FTP server using vsftpd for file transfers on your Linux server
Introduction
vsftpd (Very Secure FTP Daemon) is a secure and fast FTP server. This guide covers installation and configuration.
Step 1: Install vsftpd
Install vsftpd from the default repository.
sudo apt update
sudo apt install vsftpdStep 2: Backup Configuration
Create a backup of the default configuration file.
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.backupStep 3: Configure vsftpd
Edit the configuration file to enable local users and disable anonymous access.
sudo nano /etc/vsftpd.conf
# Set:
local_enable=YES
write_enable=YES
chroot_local_user=YES
anonymous_enable=NOStep 4: Create FTP User
Create a dedicated FTP user with restricted access.
sudo adduser ftpuser
sudo mkdir -p /home/ftpuser/ftp/upload
sudo chown nobody:nogroup /home/ftpuser/ftp
sudo chmod a-w /home/ftpuser/ftp
sudo chown ftpuser:ftpuser /home/ftpuser/ftp/uploadStep 5: Restart vsftpd
Restart the vsftpd service to apply changes.
sudo systemctl restart vsftpdStep 6: Configure Firewall
Allow FTP traffic through the firewall.
sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ufw allow 990/tcp
sudo ufw allow 40000:50000/tcpConclusion
Your FTP server is now configured and ready to use. Consider using SFTP or FTPS for enhanced security.
#FTP#vsftpd#File Transfer#Linux#Security