| 123456789101112131415161718192021222324 |
- FROM debian:bookworm-slim
- RUN apt-get update && apt-get install -y --no-install-recommends \
- openssh-server && \
- rm -rf /var/lib/apt/lists/*
- # Compte testuser — mot de passe requis pour déverrouiller le compte PAM
- RUN useradd -m -s /bin/bash testuser && \
- echo "testuser:testuser" | chpasswd && \
- mkdir -p /home/testuser/.ssh && \
- chmod 700 /home/testuser/.ssh
- # Clé publique gateway → authorized_keys des destinations
- # Générée par le script init-keys.sh avant le build
- COPY keys/gateway_rsa.pub /home/testuser/.ssh/authorized_keys
- RUN chmod 600 /home/testuser/.ssh/authorized_keys && \
- chown -R testuser:testuser /home/testuser/.ssh
- # sshd_config destination
- RUN mkdir -p /run/sshd
- COPY dest/sshd_config /etc/ssh/sshd_config
- EXPOSE 22
- CMD ["/usr/sbin/sshd", "-D", "-e"]
|