Caddy_rsync_webserver/Dockerfile

29 lines
830 B
Docker
Raw Permalink Normal View History

2024-02-05 03:19:08 +00:00
FROM ubuntu:latest
RUN apt-get update && apt-get install -y openssh-server rsync
RUN mkdir /var/run/sshd
#ARG ROOT_PASSWORD
#RUN echo root:${ROOT_PASSWORD} | chpasswd
#RUN sed -i 's/#\?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/#\?SyslogFacility AUTH/SyslogFacility AUTH/' /etc/ssh/sshd_config
RUN sed -i 's/#\?LogLevel INFO/LogLevel DEBUG/' /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
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
COPY rsync_webserver.pub /root/authorized_keys
RUN mkdir ~/.ssh && \
mv ~/authorized_keys ~/.ssh/authorized_keys && \
chmod 0600 ~/.ssh/authorized_keys && \
chmod 0700 ~/.ssh
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]