Skip to content

Instantly share code, notes, and snippets.

@MrMikeFloyd
Last active February 4, 2021 08:22
Show Gist options
  • Save MrMikeFloyd/9a18ff946d72cd85a9e9b6c1dad01543 to your computer and use it in GitHub Desktop.
Save MrMikeFloyd/9a18ff946d72cd85a9e9b6c1dad01543 to your computer and use it in GitHub Desktop.
Dockerfile for a minimal Ubuntu instance containing a number of LDAP client utilities that allows SSH login and X11 forwarding.
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install sudo vim inetutils-ping traceroute curl xbase-clients x11-apps openssh-server jxplorer ldapvi ldap-utils -y
RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1000 ldapuser
RUN echo 'ldapuser:ldappwd' | chpasswd
RUN echo 'X11UseLocalhost no' >> /etc/ssh/sshd_config
RUN echo 'AddressFamily inet' >> /etc/ssh/sshd_config
RUN service ssh start
EXPOSE 22
CMD ["/usr/sbin/sshd","-D"]
@MrMikeFloyd
Copy link
Author

Build with docker build -t ldaputils-ubuntu ., then run it with docker run -p 2022:22 ldaputils-ubuntu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment