Files
Athena-Deck/integrations/hermes-unraid/ssh-sandbox/start.sh
T

16 lines
527 B
Bash

#!/bin/bash
set -euo pipefail
mkdir -p /run/sshd /config/hostkeys /workspace /home/pn /tmp/hermes-runtime
chown pn:pn /home/pn /workspace /tmp/hermes-runtime
chmod 700 /tmp/hermes-runtime
for kind in ed25519 rsa; do
key="/config/hostkeys/ssh_host_${kind}_key"
if [[ ! -f "$key" ]]; then ssh-keygen -q -t "$kind" -N '' -f "$key"; fi
done
chmod 755 /config
chmod 700 /config/hostkeys
chown pn:pn /config/authorized_keys
chmod 600 /config/authorized_keys /config/hostkeys/*_key
/usr/sbin/sshd -t
exec /usr/sbin/sshd -D -e