-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile-alt
19 lines (18 loc) · 950 Bytes
/
Dockerfile-alt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM ubuntu:trusty
RUN apt-get update && apt-get upgrade -y && apt-get install -y ed ssh rsyslog fail2ban openssh-server openssh-client supervisor python-pyinotify libpam-google-authenticator && apt-get clean
ENV DEBIAN_FRONTEND noninteractive
# Set up directories
RUN mkdir -p /var/run/sshd /var/log/supervisor /var/run/fail2ban
# Enable google-auth
RUN sed -i '2i auth required pam_google_authenticator.so' /etc/pam.d/sshd
RUN sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/' /etc/ssh/sshd_config
RUN adduser user --disabled-login && adduser user adm && adduser user sudo
COPY fail2ban-supervisor.sh /usr/local/bin/
COPY ssh/* /root/.ssh/
COPY supervisor.d/* /etc/supervisor/conf.d/
COPY fail2ban/* /etc/fail2ban/
COPY ssh/* /home/user/.ssh/
COPY google_authenticator /home/user/.google_authenticator
RUN chown -R user: /home/user/
CMD ["/usr/bin/supervisord","-c","/etc/supervisor/supervisord.conf"]
EXPOSE 22