No Description

dependabot[bot] e0de391314 Bump docker/setup-buildx-action from 1.5.1 to 1.6.0 1 week ago
.github e0de391314 Bump docker/setup-buildx-action from 1.5.1 to 1.6.0 1 week ago
CHANGELOG.md a690c79616 changelog: added missing "Unreleased" section 2 months ago
Dockerfile 1f68792bf8 Bump alpine from 3.14.1 to 3.14.2 2 weeks ago
Makefile 64da870f82 single-user openssh ssh server restricted to sftp 5 months ago
README.md afc4bee9db added readme 5 months ago
docker-compose.yml 64da870f82 single-user openssh ssh server restricted to sftp 5 months ago
entrypoint.sh 64da870f82 single-user openssh ssh server restricted to sftp 5 months ago
sshd_config 64da870f82 single-user openssh ssh server restricted to sftp 5 months ago

README.md

docker: sftpd 💾 🐳 🐙

Single-user OpenSSH server restricted to SFTP access

$ sudo docker run --name sftpd \
    -v ssh_host_keys:/etc/ssh/host_keys:rw \
    -v /somewhere:/data:rw \
    --tmpfs /home/nonroot/.ssh,size=16k \
    -p 2200:2200 \
    -e SSH_CLIENT_PUBLIC_KEYS="$(cat ~/.ssh/id_*.pub)" \
    --read-only --security-opt=no-new-privileges \
    --cap-drop=ALL --cap-add SETUID --cap-add SETGID --cap-add SYS_CHROOT \
    docker.io/fphammerle/sftpd

$ sshfs -p 2200 nonroot@localhost:/ /mount/point

sudo docker may be replaced with podman.

Pre-built docker images are available at https://hub.docker.com/r/fphammerle/sftpd/tags (mirror: https://quay.io/repository/fphammerle/sftpd?tab=tags)

Annotation of signed git tags docker/* contains docker image digests: https://github.com/fphammerle/docker-sftpd/tags

Detached signatures of images are available at https://github.com/fphammerle/container-image-sigstore (exluding automatically built latest tag).

Docker Compose 🐙

  1. git clone https://github.com/fphammerle/docker-sftpd
  2. Adapt public keys to SSH_CLIENT_PUBLIC_KEYS in docker-compose.yml
  3. docker-compose up --build