Skip to content

Instantly share code, notes, and snippets.

@xorz57
Last active August 12, 2022 06:41
Show Gist options
  • Save xorz57/3f12639b85d84f9c7cdf16529298b1a5 to your computer and use it in GitHub Desktop.
Save xorz57/3f12639b85d84f9c7cdf16529298b1a5 to your computer and use it in GitHub Desktop.
Docker Image based on Ubuntu Focal with SSH
FROM ubuntu:focal
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y ssh && \
apt-get clean
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/g' /etc/ssh/sshd_config && \
sed -i 's/#LogLevel INFO/LogLevel INFO/g' /etc/ssh/sshd_config && \
service ssh restart
# RUN echo root:root | chpasswd
RUN useradd -m -s /bin/bash ubuntu && \
echo ubuntu:ubuntu | chpasswd
CMD [ "/usr/sbin/sshd", "-D", "-e" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment