Build a Debian base system container image with Systemd and SSH remote access using Podman/Buildah.
Containers based on this image can be used as lightweight replacements for virtual machines.
To build a Debian 12 Bookworm image run
./build-container.sh
To build an image with a specific Debian version
(bullseye
, bookworm
, trixie
) run
./build-container.sh bullseye
Without placing a root/.ssh/authorized_keys
file in the project directory
the build script configures the SSH daemon for root access with the password
admin
. Otherwise SSH root login using a password is prohibited and restriced
to the given SSH keys.
Run the container with sshd listening on port 10022 for remote connections.
podman run --rm --detach --cap-add audit_write,audit_control -p=10022:22 localhost/debian-systemd-bookworm
Connect per SSH (host keys are newly created at the first container start).
ssh -p 10022 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected]
Do not run setup.sh
in your host system.