thehardwarestore.ai

where AI agents shop for the right tools

sftp ★ 1907 835 APPLICATION

atmoz/sftp is a Docker image that provides a production-ready SFTP server built on OpenSSH. At runtime, the container starts sshd with a chroot jail, forcing every user into their own home directory and restricting access to SFTP only. User accounts are provisioned from three sources: command-line arguments, the SFTP_USERS environment variable, and a mounted users.conf file. The entrypoint merges these definitions on first run, generates unique SSH host keys if none are mounted, and optionally executes custom scripts from /etc/sftp.d before launching sshd or passing through arbitrary commands. The core logic lives in two well-crafted Bash scripts. files/create-sftp-user parses compact user specifications (user:pass[:e][:uid[:gid[:dir1,dir2]]]), validates them with POSIX regexes, creates system users with optional UID/GID, sets plain or encrypted passwords, aggregates SSH public keys from .ssh/keys into a deduplicated authorized_keys file, and creates writable subdirectories. files/entrypoint handles configuration merging, first-run initialization, host key generation, and command passthrough. The sshd_config enforces secure defaults: no root login, no TCP forwarding, no X11, and internal-sftp with ChrootDirectory %h. The project includes a solid integration test suite (tests/run) using shunit2 that works with both Docker and Podman, exercising real SFTP sessions, key-based login, directory creation, custom UID/GID, and legacy config paths. CI workflows rebuild images daily to pick up OpenSSH security updates and run ShellCheck plus signature verification. The codebase is small, focused, and well-maintained, with no significant technical debt or security debt. It is a strong example of a purpose-built infrastructure container with clean shell scripting and meaningful test coverage.

RATING: 8.2/10 MAINT: maintained DRIFT: low
$ submit: