krul-ldap-docker/Dockerfile

43 lines
1.3 KiB
Docker
Raw Normal View History

2021-02-04 02:02:57 +00:00
FROM debian:stable
MAINTAINER busti <oss@busti.cool>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt install -y --no-install-recommends \
openssh-server \
sssd \
sssd-ldap \
libnss-sss \
libpam-sss \
libpam-modules \
gettext \
2021-02-05 06:11:25 +00:00
supervisor \
2021-02-04 02:02:57 +00:00
&& apt-get autoclean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /var/run/sshd
RUN passwd --lock root
RUN sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd
RUN sed -i 's/#*PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
RUN echo "AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys" >> /etc/ssh/sshd_config
RUN echo "AuthorizedKeysCommandUser nobody" >> /etc/ssh/sshd_config
RUN echo "session optional pam_mkhomedir.so" >> /etc/pam.d/common_session
RUN echo "proc /proc proc defaults,hidepid=2 0 0" >> /etc/fstab
WORKDIR /home
EXPOSE 22
COPY sssd.conf /etc/sssd/sssd.conf.env
COPY nsswitch.conf /etc/nsswitch.conf
COPY common-session /etc/pam.d/common-session
COPY skel /etc/skel
2021-02-05 06:11:25 +00:00
COPY supervisord.conf /etc/supervisord.conf
COPY sssd.sv.conf /etc/supervisor/conf.d/sssd.sv.conf
COPY sshd.sv.conf /etc/supervisor/conf.d/sshd.sv.conf
2021-02-04 02:02:57 +00:00
2021-02-05 06:11:25 +00:00
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]