Mount S3 buckets and serve them over sftp.
Passwords of users need to be encrypted, use echo -n "your-password" | docker run -i --rm atmoz/makepasswd --crypt-md5 --clearfrom=-
to encrypt the password.
# /etc/s3sftp/users.conf
username:encrypted-password:1001
List all buckets that need to be mounted and for which user. You can mount one bucket to multiple places.
# /etc/s3sftp/buckets.conf
bucket-name:username:mountpoint
Environment variables:
ACCESS_KEY=
SECRET_KEY=
S3_URL=
Host keys are stored in /etc/ssh/keys
, use a volume to persist them between containers.
version: "3"
services:
sftp:
image:
environment:
- ACCESS_KEY=key
- SECRET_KEY=secret
- S3_URL=https://s3-service.io
volumes:
- ./users.conf:/etc/s3sftp/users.conf
- ./buckets.conf:/etc/s3sftp/buckets.conf
- ./keys/:/etc/ssh/keys
An example is provided in docker-compose.yml
and config/
.