diff --git a/Dockerfile b/Dockerfile index adfbce4..b4eb964 100644 --- a/Dockerfile +++ b/Dockerfile @@ -155,6 +155,7 @@ ADD bin /home/box/bin # Keep some etc configuration files RUN mkdir /home/box/etc +RUN cp -R /etc/ssh /etc/ssh.default RUN mv /etc/ssh /home/box/etc RUN ln -s /home/box/etc/ssh /etc/ssh diff --git a/my_init.d/000_before_regen_ssh_host_keys.sh b/my_init.d/000_before_regen_ssh_host_keys.sh new file mode 100755 index 0000000..7a65865 --- /dev/null +++ b/my_init.d/000_before_regen_ssh_host_keys.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +if [[ ! -e /etc/service/sshd/down && ! -e /home/box/etc/ssh/sshd_config ]] || [[ "$1" == "-f" ]]; then + cp -R /etc/ssh.default/* /home/box/etc/ssh/ +fi \ No newline at end of file