|
1 year ago | |
---|---|---|
.drone.yml | 1 year ago | |
Dockerfile | 1 year ago | |
README.md | 1 year ago | |
docker-compose.yml | 1 year ago | |
entrypoint.sh | 1 year ago |
README.md
SFTP server
Restricted SSH server which allows SFTP access only. This image is meant to provide an ability to update content in data containers. You would normally make a constellation of your service, a data container, and the sftp-server container.
The sftp-server container is configured at runtime with environment variables to match the configuration of the main service. The environment variables are:
Environment Variables:
AUTHORIZED_KEYS
- contains the public SSH keys for the users who will be allowed to upload.USERID
- The numeric id of thedata
account. Defaults to 33.GROUPID
- The numeric id of thedata
group. Defaults to 33.
Volumes:
/home/data
- Directory where all your data is/etc/ssh/host_keys
- GeneratedHostKeys
go here. Mount a volume here so they don't get regenerated all the time the container boots.
Running
It is easiest if you use docker-compose. Then you can specify the authorized SSH keys in a block declaration:
docker-compose.yml file:
sftpserver:
image: r3pek/sftp-server
ports:
- <PORT>:22
environment:
AUTHORIZED_KEYS: |
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA4FhFro3H....vg0hrC3s0= My First CERT
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAteQ38qb7....uC839w== Second authorized key
USERID: 500
GROUPID: 500
volumes:
- <DATADIR>:/home/data
httpd:
image: httpd
ports:
- 80:80
volumes_from:
- htdocs
htdocs:
image: tianon/true
volumes:
- <DATADIR>:/usr/local/apache2/htdocs
When started you can upload data into the container as the data
user:
sftp -P <PORT> data@<DOCKER-HOST>
Original code and idea is from https://github.com/gituser173/docker-scp-server.
Forked from https://github.com/eea/eea.docker.scp-server