forked from gituser173/docker-scp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 1.07 KB
/
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
FROM debian:stable
RUN apt-get update
RUN apt-get install -y openssh-server rssh \
&& rm -f /etc/ssh/ssh_host_*
RUN useradd --uid 1000 --no-create-home --shell /usr/bin/rssh data \
&& mkdir /home/data \
&& chown data: /home/data \
&& chmod 0700 /home/data
ENV SSH_DIR /home/data/.ssh
ENV AUTHORIZED_KEYS_FILE authorized_keys
RUN echo "AuthorizedKeysFile $SSH_DIR/$AUTHORIZED_KEYS_FILE" >>/etc/ssh/sshd_config \
&& mkdir -p $SSH_DIR \
&& chown data $SSH_DIR \
&& chmod 0700 $SSH_DIR \
&& touch $SSH_DIR/$AUTHORIZED_KEYS_FILE \
&& chown data $SSH_DIR/$AUTHORIZED_KEYS_FILE \
&& chmod 0600 $SSH_DIR/$AUTHORIZED_KEYS_FILE
RUN mkdir /var/run/sshd && chmod 0755 /var/run/sshd
RUN echo "KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1" >> /etc/ssh/sshd_config
RUN echo "allowscp" >> /etc/rssh.conf
RUN echo "allowsftp" >> /etc/rssh.conf
ADD entrypoint.sh /
CMD ["/entrypoint.sh"]
EXPOSE 22
VOLUME /home/data