spiegelei-server/entrypoint.sh
2024-06-20 22:25:23 +02:00

20 lines
563 B
Bash
Executable File

#!/bin/sh
set -e
## HOST KEYS ##
mkdir -p /host_keys
chmod 700 /host_keys
# check whether they exist
if [[ ! -f /host_keys/ssh_host_rsa_key || ! -f /host_keys/ssh_host_ecdsa_key || ! -f /host_keys/ssh_host_ed25519_key || ! -f /host_keys/ssh_host_rsa_key.pub || ! -f /host_keys/ssh_host_ecdsa_key.pub || ! -f /host_keys/ssh_host_ed25519_key.pub ]]; then
# create new keys
mkdir -p /host_keys/etc/ssh
ssh-keygen -A -f /host_keys
mv /host_keys/etc/ssh/* /host_keys/
rmdir /host_keys/etc/ssh
fi
## RUN SSH SERVER ##
/usr/sbin/sshd -D -f /etc/ssh/sshd_config