forked from rastasheep/ubuntu-sshd
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 1000 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 1000 Bytes
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
FROM ubuntu:trusty
MAINTAINER Paulo Cesar "https://github.com/pocesar"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get dist-upgrade -q -y > /dev/null
RUN apt-get install -y openssh-server git
RUN mkdir -m 0755 /var/run/sshd
ENV PUBLIC_KEY ""
ENV IN ""
ENV USER git
RUN sed -ri 's/#?RSAAuthentication\s+.*/RSAAuthentication yes/' /etc/ssh/sshd_config
RUN sed -ri 's/#?PermitRootLogin\s+.*/PermitRootLogin no/' /etc/ssh/sshd_config
RUN sed -ri 's/#?PasswordAuthentication\s+.*/PasswordAuthentication no/' /etc/ssh/sshd_config
RUN sed -ri 's/#?PermitEmptyPasswords\s+.*/PermitEmptyPasswords no/' /etc/ssh/sshd_config
RUN sed -ri 's/#?PubkeyAuthentication\s+.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config
RUN sed -ri 's/#?UseLogin\s+.*/UseLogin no/' /etc/ssh/sshd_config
RUN sed -ri 's/#?LogLevel\s+.*/LogLevel INFO/' /etc/ssh/sshd_config
RUN sed -ri 's/#?UsePAM\s+.*/UsePAM yes/g' /etc/ssh/sshd_config
ADD run.sh /run.sh
RUN chmod +x /run.sh
EXPOSE 22
CMD ["/run.sh"]