Skip to content

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

License

Notifications You must be signed in to change notification settings

phantom-artist/vsftpd

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published