2019-05-17 22:22:28 +00:00
|
|
|
# docker-ftps
|
|
|
|
|
2019-05-17 22:41:50 +00:00
|
|
|
Simple container for FTP+TLS+authentication
|
|
|
|
|
|
|
|
## build
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker build . -t my-ftps
|
|
|
|
```
|
|
|
|
|
|
|
|
## run
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker run -d --name my-ftps \
|
|
|
|
-p 21:21 -p 20:20 -p 50000-50500:50000-50500 \
|
|
|
|
-e "MASQUERADE=ftp.mydomain.com" \
|
|
|
|
-v "$PWD/auth:/auth" -v "$PWD/ftpdata:/home" \
|
|
|
|
-v "$PWD/certs:/certs" \
|
|
|
|
my-ftps
|
|
|
|
```
|
|
|
|
|
|
|
|
The *MASQUERADE* parameter is the only required one. You can use an IP address (which is discouraged) or a DNS name.
|
|
|
|
You must provide valid certificates for TLS; if you use Lets'Encrypt, you can mofify like this:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker run -d --name my-ftps \
|
|
|
|
-p 21:21 -p 20:20 -p 50000-50500:50000-50500 \
|
|
|
|
-e "MASQUERADE=ftp.mydomain.com" \
|
|
|
|
-v "$PWD/auth:/auth" -v "$PWD/ftpdata:/home" \
|
|
|
|
-v "/etc/letsencrypt/live/ftp.mydomain.com:/certs" \
|
|
|
|
my-ftps
|
|
|
|
```
|
|
|
|
|
|
|
|
## users management
|
|
|
|
|
|
|
|
To change/set a password, do like this (replace "paolo" with the correct username):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker exec -ti my-ftps ftpasswd --passwd --name=paolo --uid=1000 --home=/home/paolo --shell=/bin/false --file=/auth/passwd
|
|
|
|
```
|
|
|
|
|
|
|
|
You also have to create and chown the user's home folder.
|