Created
February 16, 2017 06:26
-
-
Save saggie/1e9d5da7049251686109699196be969b to your computer and use it in GitHub Desktop.
Simple SSH daemon container allowing root login with empty password.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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