Locked-down SSH container with sandboxed file operations. Use as a base image to build your own d...
5.6K
Locked-down SSH container with sandboxed file operations. Use it as a base image for your own tool containers: list the allowed commands and install your binaries. No shell access, no injection bullshit.
Skip the HTTP API wrapper. Any CLI tool becomes a remote service over SSH. No REST endpoints, no request parsing, no serialization layer. Just ssh myapp@host "tool --flag arg" and you're done. Route it through Cloudflare Tunnel or Tailscale and you've got remote access without exposing a port.
shlex.split() and runs it with os.execv(). No shell is involved at any point.&&, ;, |, $() are just literal arguments. No shell means shell metacharacters are meaningless.allowed.json, it doesn't run.put, get, list-files, remove-file, create-dir, remove-dir, remove-dir-recursive, move-file, copy-file, file-info, file-exists, file-hash, disk-usage, search-files and append-file, all locked to /work (search-files can still list names outside it, see the security page).curl | sudo bash installer and host CLI for your image.The /work sandbox covers the built-in file ops. Allowed tools get their arguments as sent, so pick them carefully. The security page has the details and the known gaps.
Create allowed.json with your commands:
{
"ffmpeg": "/usr/bin/ffmpeg",
"ffprobe": "/usr/bin/ffprobe"
}
Create your Dockerfile:
FROM psyb0t/lockbox
ENV LOCKBOX_USER=myapp
RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY allowed.json /etc/lockbox/allowed.json
Build and run:
docker build -t myapp .
cat ~/.ssh/id_ed25519.pub > authorized_keys
mkdir -p work host_keys
docker run -d \
--name myapp \
--restart unless-stopped \
-p 2222:22 \
-e "LOCKBOX_UID=$(id -u)" \
-e "LOCKBOX_GID=$(id -g)" \
-v "$(pwd)/authorized_keys:/etc/lockbox/authorized_keys:ro" \
-v "$(pwd)/host_keys:/etc/lockbox/host_keys" \
-v "$(pwd)/work:/work" \
myapp
ssh -p 2222 myapp@localhost "ffmpeg -version"
Files go in and out through the built-ins:
ssh -p 2222 myapp@localhost "put input.mp4" < input.mp4
ssh -p 2222 myapp@localhost \
"ffmpeg -i /work/input.mp4 -vn /work/audio.mp3"
ssh -p 2222 myapp@localhost "get audio.mp3" > audio.mp3
Everything else lives on the documentation site: https://psyb0t.github.io/docker-lockbox/
| Page | What's there |
|---|---|
| Getting started | The quick start above, step by step |
| File operations | All 15 built-ins: arguments, output, errors |
| Configuration | allowed.json, LOCKBOX_USER/UID/GID, volumes, entrypoint.d hooks |
| Installer generator | create_installer.sh: config format, generated files, the host CLI |
| Security | What a key holder can and can't do, and the known gaps |
| Architecture | Container start and the path of a command |
| Troubleshooting | Error messages, causes and fixes |
| Development | Make targets, tests, CI and releases |
| Image | Description |
|---|---|
| psyb0t/mediaproc | FFmpeg, Sox, ImageMagick and 2200+ fonts for media processing over SSH |
| psyb0t/qwenspeak | Qwen3-TTS text-to-speech over SSH with preset voices, voice cloning and voice design |
This project is licensed under WTFPL, the Do What The Fuck You Want To Public License.
Content type
Image
Digest
sha256:04cda1934…
Size
44.8 MB
Last updated
18 days ago
docker pull psyb0t/lockbox