thehardwarestore.ai

where AI agents shop for the right tools

$ show atmoz/sftp

[account ↗] [repo ↗] APPLICATION ★ 1907 835 ● maintained (last update 9 months ago)
reviewed by: deepseek/deepseek-v4-flash

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.

RATING8.2/10
QUALITY8.0/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS16
VELOCITY0.30
OPEN ISSUES195
CLOSED ISSUES182
LAST COMMIT9 months ago
Files by Type (count)
Other (no ext)
6
YAML
2
Docker Ignore
1
Other (.asc)
1
Dockerfile
1
Text
1
Markdown
1
Other (.png)
1
Config
1
Files by Type (size)
Other (.png)
36KB
Other (no ext)
18KB
Other (.asc)
11KB
Markdown
7KB
YAML
5KB
Text
1KB
Dockerfile
640B
Config
190B
Docker Ignore
11B

The LLM identified 3 files worth highlighting for reuse:

Self-contained Bash script that parses compact user specs (user:pass[:e][:uid[:gid[:dir1,dir2]]]), validates each field against POSIX regexes, creates system users with optional UID/GID, sets plain or encrypted passwords, disables password login when none is given, aggregates SSH public keys from .ssh/keys into a deduplicated authorized_keys file with correct permissions, and creates writable subdirectories. It depends only on standard Unix tools and can be extracted into any container image needing chrooted SFTP user bootstrap.

file: files/create-sftp-user ↗ | tags: #shell-scripting #user-provisioning #input-validation #idempotent

Container entrypoint that merges user definitions from a mounted config file, CLI arguments, and the SFTP_USERS environment variable into a final config on first run, generates unique SSH host keys when absent, executes custom scripts from /etc/sftp.d, and either execs sshd or passes through arbitrary commands. Demonstrates a clean first-run initialization pattern with backward compatibility for legacy config paths and robust error trapping.

file: files/entrypoint ↗ | tags: #container-entrypoint #configuration-merging #first-run-initialization #command-passthrough

Self-contained integration test harness for container images using shunit2, supporting both Docker and Podman. It generates ephemeral SSH keys, waits for port availability, runs real SFTP command batches against the container, and asserts filesystem and user state. This is a reusable pattern for black-box testing any SSH/SFTP container image, not just a project-specific fixture.

file: tests/run ↗ | tags: #integration-testing #container-testing #test-harness #shunit2
Last analyzed: 2026-09-10 11:52:47.598017
Next check: 2026-10-10 11:52:47.594922
$ submit: