phantom-artist / vsftpd

Docker image for running vsftpd in a container using virtual users and persisting user config + data in external volumes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vsftpd

Docker image for running a vsftpd container using virtual users, based on the excellent work at fauria / docker-vsftpd Check that solution for a detailed list of settings that can be applied to this image at runtime.

The main differences are that this solution attempts to build on docker-vsftpd to allow permanent storage of users / data on volumes which persists across the lifecycle of the container.

SECURITY WARNING: FTP is not a secure protocol and 'crypt' is not a secure function by today's standards. If you want robust security around your users and data, do not use vsftpd and opt for a sftp-based solution where strong encryption and key-based authentication can be implemented.

This is definitely a "use-at-your-own-risk" solution, primarily done as an exercise, and I accept no liability for the security of your data if you implement this solution :)

Build

docker build -t my-ftp .

Example Run

docker run -d --name my-ftp \
-p8020:20 \
-p8021:21 \
-p 21100-21110:21100-21110 \
-e PASV_MIN_PORT=21100 \
-e PASV_MAX_PORT=21110 \
-e PASV_ADDRESS=< host IP > \
-v /path/to/volume/users:/etc/vsftpd/db \
-v /path/to/volume/log:/var/log/vsftpd \
-v /path/to/volume/data:/home/vsftpd \
my-ftp

Add A User

docker exec -ti my-ftp /bin/bash

addftpuser.sh

Change A User Password

docker exec -ti my-ftp /bin/bash

modftpuser.sh

Delete A User Account (not the data)

docker exec -ti my-ftp /bin/bash

delftpuser.sh

Delete A User's Data (can only be run after delftpuser.sh)

docker exec -ti my-ftp /bin/bash

delftpdata.sh

Connect to FTP Service

ftp host-running-the-container 8021

About

Docker image for running vsftpd in a container using virtual users and persisting user config + data in external volumes

License:Apache License 2.0


Languages

Language:Shell 87.6%Language:Dockerfile 12.4%