2020-03-22 11:16:35 +00:00
|
|
|
FROM alpine
|
|
|
|
|
|
|
|
RUN apk -U add openssh-server openssh-sftp-server sudo python3
|
|
|
|
RUN adduser -D user
|
|
|
|
RUN passwd -u user
|
|
|
|
RUN passwd -u root
|
|
|
|
RUN echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
|
|
|
|
RUN echo "PasswordAuthentication no" > /etc/ssh/sshd_config
|
|
|
|
RUN echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config
|
|
|
|
RUN echo "AuthorizedKeysFile /etc/ssh/authorized_keys" >> /etc/ssh/sshd_config
|
|
|
|
RUN echo "PermitRootLogin no" >> /etc/ssh/sshd_config
|
2020-03-22 11:53:06 +00:00
|
|
|
RUN echo "Subsystem sftp /usr/lib/ssh/sftp-server" >> /etc/ssh/sshd_config
|
2020-03-22 11:16:35 +00:00
|
|
|
|
|
|
|
RUN ssh-keygen -A
|
|
|
|
|
|
|
|
COPY test.sh /
|
|
|
|
|
|
|
|
ENTRYPOINT ["/test.sh"]
|