├── Dockerfile └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | RUN apt-get update && apt-get install -y openssh-server 4 | RUN mkdir /var/run/sshd 5 | RUN echo 'root:Passw0rd' | chpasswd 6 | RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config 7 | 8 | # SSH login fix. Otherwise user is kicked off after login 9 | RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd 10 | 11 | ENV NOTVISIBLE "in users profile" 12 | RUN echo "export VISIBLE=now" >> /etc/profile 13 | 14 | EXPOSE 22 15 | CMD ["/usr/sbin/sshd", "-D"] 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ubuntu-ssh-enabled 2 | 3 | NOTE: THIS IMAGE IS TO BE USED FOR TEST AND LEARNIGN PURPOSES ONLY! NOT TO BE USED IN A PRODUCTION ENVIRONMENT! 4 | 5 | SSH Enabled Ubuntu Image for Test and Dev purposes ONLY! 6 | 7 | ## Use: 8 | 9 | Run the container: 10 | 11 | ```docker run -d mmumshad/ubuntu-ssh-enabled``` 12 | 13 | Identify the Internal IP 14 | 15 | ```docker inspect ``` 16 | 17 | SSH 18 | 19 | ```ssh ``` 20 | 21 | **Username:** root 22 | 23 | **Password:** Passw0rd 24 | 25 | Based on : https://docs.docker.com/engine/examples/running_ssh_service/ 26 | --------------------------------------------------------------------------------