20 lines
578 B
Bash
20 lines
578 B
Bash
|
#!/bin/sh
|
||
|
set -e
|
||
|
|
||
|
## HOST KEYS ##
|
||
|
mkdir -p /host_keys
|
||
|
chmod 700 /host_keys
|
||
|
|
||
|
# check whethre 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
|