# Start from a Debian image.
FROM debian:11

# Install necessary packages
RUN apt-get update && apt-get install -y \
    openssh-server \
    wget

# Create directory for SSH daemon.
RUN mkdir /var/run/sshd

# Set the root password to something known so we can SSH.
RUN echo 'root:root' | chpasswd

# Permit root login via SSH
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

# Expose the SSH port so we can connect to it.
EXPOSE 22

# Run the SSH daemon
CMD ["/usr/sbin/sshd", "-D"]
