Giter Site home page Giter Site logo

docker-vsftpd's Introduction

fauria/vsftpd

docker_logodocker_fauria_logo

This Docker container implements a vsftpd server, with the following features:

  • Centos 7 base image.
  • vsftpd 3.0
  • Virtual users
  • Passive mode
  • Logging to a file or STDOUT.

Installation from Docker registry hub.

You can download the image with the following command:

docker pull fauria/vsftpd

Environment variables

This image uses environment variables to allow the configuration of some parameteres at run time:

  • Variable name: FTP_USER
  • Default value: admin
  • Accepted values: Any string. Avoid whitespaces and special chars.
  • Description: Username for the default FTP account. If you don't specify it through the FTP_USER environment variable at run time, admin will be used by default.

  • Variable name: FTP_PASS
  • Default value: Random string.
  • Accepted values: Any string.
  • Description: If you don't specify a password for the default FTP account through FTP_PASS, a 16 characters random string will be automatically generated. You can obtain this value through the container logs.

  • Variable name: LOG_STDOUT
  • Default value: Empty string.
  • Accepted values: Any string to enable, empty string or not defined to disable.
  • Description: Output vsftpd log through STDOUT, so that it can be accessed through the container logs.

Exposed ports and volumes

The image exposes ports 20 and 21, along with the range 21100 - 21110 for passive mode. Also, exports two volumes: /home/vsftpd, which contains users home directories, and /var/log/vsftpd, used to store logs.

When sharing a homes directory between the host and the container (/home/vsftpd) the owner user id and group id should be 14 and 80 respectively. This correspond ftp user and ftp group on the container, but may match something else on the host.

Use cases

  1. Create a temporary container for testing purposes:
  docker run --rm fauria/vsftp
  1. Create a container with default user account, binding a data directory:
docker run -d -p 21:21 -v /my/data/directory:/home/vsftpd --name vsftpd fauria/vsftpd
# see logs for credentials:
docker logs vsftpd  
  1. Create a container with a custom user account, binding a data directory and enabling both active and passive mode:
docker run -d -v /my/data/directory:/home/vsftpd \
-p 20:20 -p 21:21 -p 21100:21100 -p 21101:21101 \
-p 21102:21102 -p 21103:21103 -p 21104:21104 \
-p 21105:21105 -p 21106:21106 -p 21107:21107 \
-p 21108:21108 -p 21109:21109 -p 21110:21110 \
-e FTP_USER=myuser -e FTP_PASS=mypass \
 --name vsftpd fauria/lap
  1. Manually add a new FTP user to the container:
docker exec -i -t vsftpd bash
mkdir /home/vsftpd/myuser
echo -e "myuser\nmypass" >> /etc/vsftpd/virtual_users.txt
/usr/bin/db_load -T -t hash -f /etc/vsftpd/virtual_users.txt /etc/vsftpd/virtual_users.db
exit
docker restart vsftpd

docker-vsftpd's People

Contributors

fauria avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.