FTP server with vsftpd
Set up a secure FTP server to transfer files to the container.
What this tutorial does
The tutorial "FTP server with vsftpd" helps you achieve this goal:
Set up a secure FTP server to transfer files to the container.
Debian/Ubuntu
-
Install vsftpd: apt install -y vsftpd - Edit /etc/vsftpd.conf and activate/modify these lines:
- anonymous_enable=NO
- local_enable=YES
- write_enable=YES
- chroot_local_user=YES
- allow_writeable_chroot=YES
- pasv_enable=YES
- pasv_min_port=40000
- pasv_max_port=50000
- --- Create a dedicated FTP user ---
- adduser ftpuser
- mkdir -p /home/ftpuser/files
-
chown ftpuser:ftpuser /home/ftpuser/files -
--- Open ports in iptables --- -
iptables -A INPUT -p tcp --dport 21 -j ACCEPT -
iptables -A INPUT -p tcp --dport 40000:50000 -j ACCEPT - netfilter-persistent save
- --- Start vsftpd ---
-
systemctl enable --now vsftpd -
FTP connection from a client: ftp://IP with the ftpuser identifier