#!/bin/sh # Wait for OpenBao's SSH CA (generated by docker/seed.sh), trust it, then run sshd in the foreground. set -eu CA_URL="${BAO_ADDR:-http://openbao:8200}/v1/ssh/public_key" i=0 until curl -fsS "$CA_URL" -o /etc/ssh/trusted-user-ca-keys.pem 2>/dev/null && [ -s /etc/ssh/trusted-user-ca-keys.pem ]; do i=$((i + 1)) [ "$i" -le 60 ] || { echo "No SSH CA at $CA_URL after 60 tries" >&2; exit 1; } echo "Waiting for the SSH CA at $CA_URL ..." sleep 2 done echo "Trusting the CA from $CA_URL" exec /usr/sbin/sshd -D -e