Commit 1da68487 authored by nimrod's avatar nimrod
Browse files

SSH daemon WIP.

parent ca3e38c9
Pipeline #1906 failed with stages
in 1 minute and 14 seconds
ARG BASEIMAGE=debian:testing-slim
FROM ${BASEIMAGE}
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
netcat-openbsd \
openssh-server \
&& \
rm -f /etc/ssh/ssh_host_* && \
echo > /etc/ssh/sshd_config && \
rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /var/cache/apt/archives/*
COPY entrypoint /entrypoint
EXPOSE 22
ENTRYPOINT ["/entrypoint"]
HEALTHCHECK --start-period=5m CMD echo | nc localhost 22 | grep -q 'SSH-2.0-OpenSSH'
ENV SSHD_ARGS="-De -o 'PermitRootLogin no' -o 'PasswordAuthentication no' -o 'ChallengeResponseAuthentication no' -o 'PrintMotd no' -o 'PidFile none' -o 'Subsystem sftp /usr/lib/openssh/sftp-server'"
ENV EXTRA_SSHD_ARGS=""
CMD ["/usr/sbin/sshd", "$SSHD_ARGS", "$EXTRAS_SSHD_ARGS"]
# sshd
> A dockerized SSH daemon.
#!/bin/sh
set -eux
if [ ! -f /etc/ssh/moduli ]
then
ssh-keygen -G /etc/ssh/moduli.candidates
ssh-keygen -T /etc/ssh/moduli -f /etc/ssh/moduli.candidates
rm /etc/ssh/moduli.candidates
fi
ssh-keygen -A
mkdir -p /run/sshd
eval "exec $@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment