#!/bin/bash set -e # Setup SSH authorized keys from environment variable if [ -n "$SSH_AUTHORIZED_KEYS" ]; then echo "$SSH_AUTHORIZED_KEYS" > /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys echo "SSH authorized keys configured" fi # Generate host keys if they don't exist if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then ssh-keygen -A fi # Execute the command passed to the container exec "$@"