https://github.com/lionello/alpine-sshd
Minimal container image for running SSHD
https://github.com/lionello/alpine-sshd
Last synced: 2 months ago
JSON representation
Minimal container image for running SSHD
- Host: GitHub
- URL: https://github.com/lionello/alpine-sshd
- Owner: lionello
- License: mit
- Created: 2023-10-19T20:27:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-13T17:48:29.000Z (12 months ago)
- Last Synced: 2025-02-05T23:27:31.152Z (4 months ago)
- Language: Dockerfile
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# alpine-sshd
This repository contains a `Dockerfile` to build a Docker image with an SSH
server. It's based on Alpine Linux and installs OpenSSH (`sshd`).## User
The Dockerfile creates an unprivileged user account with no password and no
shell. The username can be set by providing the build-arg `USER` when building
the image. The default is `tunnel`.## Public keys
The SSH server needs to be configured with host keys before it'll start. The
host public keys and the `authorized_keys` file can be written either during
the build or at runtime. At runtime, the env var `tunnel_authorized_keys` will be
written to `/home/tunnel/.ssh/authorized_keys`.## Host keys
Adding the private host keys to the built image would be insecure, so this image
grabs the host keys from the environment at runtime. The host keys are then
written to the appropriate files before the SSH server is started, eg. the env
var `ssh_host_ed25519_key_pub` will be written to `/etc/ssh/ssh_host_ed25519_key.pub`.