SSHD-Container Dockerfile
This commit is contained in:
commit
29c8b3e8d1
22
ssh/Dockerfile
Normal file
22
ssh/Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
FROM ubuntu:18.04
|
||||||
|
MAINTAINER Aleksandar Diklic "https://github.com/rastasheep"
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
|
||||||
|
RUN apt-get install -y openssh-server
|
||||||
|
RUN mkdir /var/run/sshd
|
||||||
|
|
||||||
|
RUN echo 'root:root' |chpasswd
|
||||||
|
|
||||||
|
RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||||
|
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
|
||||||
|
|
||||||
|
RUN mkdir /root/.ssh
|
||||||
|
|
||||||
|
RUN apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
EXPOSE 22
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/sshd", "-D"]
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user