Last active
August 25, 2020 17:40
-
-
Save Himura2la/46038ff7cf73477a16d910d62d598248 to your computer and use it in GitHub Desktop.
sshd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stable-slim | |
EXPOSE 22 | |
RUN apt-get update && apt-get install -y openssh-server | |
RUN mkdir /var/run/sshd &&\ | |
sed -e 's/#PasswordAuthentication yes/PasswordAuthentication no/' \ | |
-e 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' \ | |
-e 's/#ClientAliveInterval 0/ClientAliveInterval 60/' \ | |
-i /etc/ssh/sshd_config | |
RUN useradd -m -s /bin/bash user | |
COPY authorized_keys /home/user/.ssh/authorized_keys | |
RUN cd /home/user/.ssh && chown -vR user:user . && chmod -v 700 . && chmod -v 600 * | |
CMD ["/usr/sbin/sshd", "-D"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment