To configure vsftpd (Very Secure FTP Daemon), follow these steps:
-
Install vsftpd:
sudo apt update sudo apt install vsftpd -
Backup the Default Configuration:
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak -
Edit the Configuration File:
Open the configuration file in a text editor:sudo nano /etc/vsftpd.confHere are some common settings you might want to adjust:
anonymous_enable=NO # Disable anonymous login local_enable=YES # Enable local users to log in write_enable=YES # Allow users to upload files chroot_local_user=YES # Restrict users to their home directories allow_writeable_chroot=YES # Allow writing in chrooted directories -
Set Up User Accounts:
Create a user account for FTP access:sudo adduser ftpuser -
Set Permissions:
Ensure the user has the correct permissions for their home directory:sudo chown ftpuser:ftpuser /home/ftpuser -
Restart vsftpd:
After making changes, restart the vsftpd service:sudo systemctl restart vsftpd -
Allow FTP Through the Firewall (if applicable):
sudo ufw allow 20/tcp sudo ufw allow 21/tcp -
Test the FTP Server:
Use an FTP client or command line to connect:ftp localhost
This basic setup should get your vsftpd server running. For more advanced configurations, refer to the vsftpd documentation or specific use cases. If you have any specific requirements or questions, feel free to ask!
