I am looking to create a docker image that EVE will start and I can telnet to and also has lots of useful tools like client based ping, telnet, ssh etc to be used as easy access to test client access over cisco LAN.
None of the eve docker images seem to listen to telnet.
I have created a docker file to startup sshd and telnetd/inetd on startup, but when I run in EVE it only starts /bin/sh and ignores the CMD option?
How can I get EVE to be able to connect to telnet on the Docker image (i.e. when I click on the device in native console and it lauches putty)?
Thanks in advance
Tony Dean
=============================================
/usr/sbin/startup.sh
Code: Select all
#!/bin/sh
/usr/sbin/inetutils-inetd /etc/inetd.conf
/usr/sbin/sshd -D
exit 0;
Code: Select all
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y openssh-server openssh-client openssh-sftp-server openssh-blacklist openssh-blacklist-extra inetutils-telnet inetutils-telnetd net-tools
RUN mkdir /var/run/sshd
RUN echo 'root:cisco' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
RUN echo 'telnet stream tcp nowait root /usr/sbin/tcpd /usr/sbin/telnetd' > /etc/inetd.conf
RUN echo 'pts/0' >> /etc/securetty
RUN echo 'pts/1' >> /etc/securetty
RUN echo 'pts/2' >> /etc/securetty
RUN echo 'pts/3' >> /etc/securetty
RUN echo 'pts/4' >> /etc/securetty
RUN echo 'pts/5' >> /etc/securetty
RUN echo 'pts/6' >> /etc/securetty
RUN echo 'pts/7' >> /etc/securetty
RUN echo 'pts/8' >> /etc/securetty
RUN echo 'pts/9' >> /etc/securetty
RUN cp /etc/pam.d/sshd /etc/pam.d/telnet
COPY startup.sh /usr/sbin/startup.sh
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
EXPOSE 22 23
CMD ["/usr/sbin/startup.sh"]