Skip to content

Instantly share code, notes, and snippets.

@michaelneale
Created July 2, 2014 07:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelneale/491134409fa7a1c32119 to your computer and use it in GitHub Desktop.
Save michaelneale/491134409fa7a1c32119 to your computer and use it in GitHub Desktop.
Enable SSHD in docker container via systemd in arch
RUN pacman -Sqyu --noconfirm --needed openssh && \
systemctl enable sshd
# configure ssh
RUN sed -i \
-e 's/^#*\(PermitRootLogin\) .*/\1 yes/' \
-e 's/^#*\(PasswordAuthentication\) .*/\1 yes/' \
-e 's/^#*\(PermitEmptyPasswords\) .*/\1 yes/' \
-e 's/^#*\(UsePAM\) .*/\1 no/' \
/etc/ssh/sshd_config
ENV container docker
EXPOSE 22
CMD /usr/lib/systemd/systemd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment