-
-
Notifications
You must be signed in to change notification settings - Fork 324
Advanced example walk through with TLS & automatic user account
Andrew Stilliard edited this page Nov 15, 2018
·
3 revisions
Taken from our test which is run during all changes to the container.
docker pull stilliard/pure-ftpd:hardened
docker volume create --name ftp_tls
In here we're creating a demo certificate & a test user called "bob" with a password of "test"
docker run -d --name ftpd_server -p 21:21 -p 30000-30009:30000-30009 -e "PUBLICHOST=localhost" -e "ADDED_FLAGS=-d -d --tls 2" -e "TLS_CN=localhost" -e "TLS_ORG=Demo" -e "TLS_C=UK" -e"TLS_USE_DSAPRAM=true" -e FTP_USER_NAME=bob -e FTP_USER_PASS=test -e FTP_USER_HOME=/home/ftpusers/bob -v ftp_tls:/etc/ssl/private/ stilliard/pure-ftpd:hardened
Watch over the logs to see the progress, the last line should print the pure-ftpd command being used to run
When this line shows it should be all up and running and ready to use
docker logs -f ftpd_server
You can echo out the certificate path like so:
echo "$$(sudo docker volume inspect --format '{{ .Mountpoint }}' ftp_tls)/pure-ftpd.pem"
You can connect with any FTPS client, such as Filezilla
Or connect locally with the lftp
command:
certPath="$$(sudo docker volume inspect --format '{{ .Mountpoint }}' ftp_tls)/pure-ftpd.pem"
lftp -u bob,test -e "set ssl:ca-file '$certPath'" localhost 21
# now you're in!
# you can run commands list ls, get, put and rm to manage files this way and exit any time
If you have any issues, please check our Issues tab for help, check out our detailed README file or if this doesn't help please submit a new issue.