diff --git a/sshd/Dockerfile b/sshd/Dockerfile index 7f4f07d..50247bd 100644 --- a/sshd/Dockerfile +++ b/sshd/Dockerfile @@ -1,5 +1,5 @@ -FROM ubuntu -RUN apt-get update && apt-get install -y openssh-server rsync +FROM centos:7 +RUN yum update -y && yum install -y openssh-server openssh-clients rsync RUN mkdir /var/run/sshd COPY sshd_config /etc/ssh/sshd_config COPY docker-entrypoint.sh / diff --git a/sshd/docker-entrypoint.sh b/sshd/docker-entrypoint.sh index 42cc310..9450448 100644 --- a/sshd/docker-entrypoint.sh +++ b/sshd/docker-entrypoint.sh @@ -1,8 +1,4 @@ #!/bin/bash -cleanup() { - exit -} -trap cleanup HUP INT QUIT TERM if [[ (! -z "${ADDITIONAL_USER}" ) && ( "${ADDITIONAL_USER}" != "root" ) ]]; then @@ -50,6 +46,12 @@ else fi fi +rm /etc/ssh/ssh_host_*key* +ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key +ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key +ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key +ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key + usermod -s /bin/bash root /usr/sbin/sshd -D #exec "$@"