forked from DeathsPirate/aws-ec2-docker-ssh-honeypot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (26 loc) · 1006 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM debian:wheezy
WORKDIR /root
ENV DEBIAN_FRONTEND noninteractive
RUN echo exit 0 > /usr/sbin/policy-rc.d
RUN echo "root:password" | chpasswd
RUN apt-get update && apt-get install -y \
inetutils-syslogd \
python \
openssh-server \
curl \
wget \
locales \
libpam-python
RUN locale-gen en_GB.UTF-8
RUN useradd -m admin -s /bin/bash
RUN echo "admin:admin123" | chpasswd
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -ri 's/^#?PasswordAuthentication\s+.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
RUN mkdir /root/.ssh
ADD ./hp/pwreveal.py /lib/x86_64-linux-gnu/security/pwreveal.py
RUN sed -i -e "s/@include common-auth/#@include common-auth\nauth requisite pam_python.so \/lib\/x86_64-linux-gnu\/security\/pwreveal.py /" /etc/pam.d/sshd
RUN echo "" > /var/log/auth.log
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-e"]