Ubuntu FTP Server Permission Setup Guide (Using vsftpd)
vsftpd (Very Secure FTP Daemon) is the most commonly used FTP server software on Ubuntu due to its security and configurability. Below is a step-by-step guide to setting up FTP server permissions, covering installation, configuration, user management, and firewall setup.
Update your package list and install vsftpd using the following commands:
sudo apt update
sudo apt install vsftpd
Edit the vsftpd configuration file (/etc/vsftpd.conf) to customize permissions. Key settings include:
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES # Required if chroot is enabled to allow writes
anonymous_enable=NO
pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
Save changes and exit the editor (Ctrl+X → Y → Enter).
Use the adduser command to create a dedicated FTP user (replace ftpuser with your desired username):
sudo adduser ftpuser
Follow prompts to set a password and user details.
Ensure the user’s home directory has the correct ownership and permissions:
/home/ftpuser).sudo chown ftpuser:ftpuser /home/ftpuser
sudo chmod 755 /home/ftpuser # Basic access (read/list)
# OR for upload capabilities:
sudo chmod 775 /home/ftpuser
Restrict access to specific users by enabling the user list feature:
/etc/vsftpd.conf:userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
userlist_deny=NO # Set to "YES" to deny listed users (reverse logic)
/etc/vsftpd.user_list (one per line):echo "ftpuser" | sudo tee -a /etc/vsftpd.user_list
Apply configuration changes by restarting the vsftpd service:
sudo systemctl restart vsftpd
Check the service status to ensure it’s running:
sudo systemctl status vsftpd
If you’re using UFW (Uncomplicated Firewall), allow FTP traffic (ports 21 for control, 20 for data, and passive mode ports):
sudo ufw allow 21/tcp
sudo ufw allow 20/tcp
sudo ufw allow 1024:1048/tcp # Passive mode range (adjust if different)
sudo ufw reload
Use an FTP client (e.g., FileZilla) to connect to your server:
Verify that you can:
vsftpd’s virtual user support.ftpgroup) and assign permissions to groups instead of individual users.sudo systemctl enable ssh) and use an SFTP client.By following these steps, you can configure secure and functional FTP server permissions on Ubuntu using vsftpd. Always refer to the official vsftpd documentation for advanced configurations.