Skip to content

Instantly share code, notes, and snippets.

@saggie
Created February 16, 2017 06:26
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save saggie/1e9d5da7049251686109699196be969b to your computer and use it in GitHub Desktop.
Save saggie/1e9d5da7049251686109699196be969b to your computer and use it in GitHub Desktop.
Simple SSH daemon container allowing root login with empty password.
FROM ubuntu:16.04
# Install sshd
RUN apt-get update
RUN apt-get install -y openssh-server
# Modify `sshd_config`
RUN sed -ri 's/PermitEmptyPasswords no/PermitEmptyPasswords yes/' /etc/ssh/sshd_config
RUN sed -ri 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -ri 's/^UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
RUN /etc/init.d/ssh start
# Delete root password (set as empty)
RUN passwd -d root
CMD ["/usr/sbin/sshd", "-D"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment