#!/bin/sh # Prepares host keys and the test users, starts a small HTTP server for the # tunnel tests (reachable only on the target itself), then runs sshd. set -eu [ -f /etc/ssh/ssh_host_ed25519_key ] || ssh-keygen -q -t ed25519 -N '' -f /etc/ssh/ssh_host_ed25519_key for user in ops admin; do home="/home/$user" mkdir -p "$home/.ssh" cp /keys/authorized_keys "$home/.ssh/authorized_keys" chown -R "$user:$user" "$home/.ssh" chmod 700 "$home/.ssh" chmod 600 "$home/.ssh/authorized_keys" done mkdir -p /srv/www echo "hello from $(hostname)" > /srv/www/index.html python3 -m http.server 8081 --bind 127.0.0.1 --directory /srv/www >/dev/null 2>&1 & exec /usr/sbin/sshd -D -e