Skip to content

Instantly share code, notes, and snippets.

@deckerego
Last active October 10, 2020 12:37
Show Gist options
  • Save deckerego/07df2c8fa84cee82403679d4e6d71fcb to your computer and use it in GitHub Desktop.
Save deckerego/07df2c8fa84cee82403679d4e6d71fcb to your computer and use it in GitHub Desktop.
Docker image for troubleshooting networking issues (e.g. figuring out why VPC Endpoints don't work in ECS)
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y openssh-server dnsutils telnet netcat vim
RUN mkdir /var/run/sshd
RUN echo 'root:f33df4ced3adb33f' | chpasswd
RUN sed -i 's/#*PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd
ENV NOTVISIBLE="in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment