Skip to content

Enable SSH | Dockerfile

Docker
FROM debian:latest

ENV DEBIAN_FRONTEND noninteractive
# Get the basic stuff
RUN apt-get update && \
    apt-get -y upgrade && \
    apt-get install -y \
    nano procps net-tools curl openssh-server

RUN mkdir /var/run/sshd
RUN echo "root:password" | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

ENV DEBIAN_FRONTEND teletype

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]