Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
set sshd_config
  • Loading branch information
mbmcmullen27 authored Nov 11, 2023
1 parent 16d6761 commit 58aa73a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ RUN apt update -y && \
ssh-keygen -A && \
service ssh --full-restart

RUN service ssh start
RUN sed -E -i 's|#AuthorizedKeysFile(\s*).ssh/authorized_keys.*|AuthorizedKeysFile\1/home/git/.ssh/authorized_keys|' /etc/ssh/sshd_config && \
sed 's/#PubkeyAuthentication/PubkeyAuthentication/' /etc/ssh/sshd_config && \
service ssh start


USER git
WORKDIR /home/git/
Expand All @@ -39,4 +42,4 @@ RUN echo $(which git-shell) >> /etc/shells && \

EXPOSE 22
# "-e" lets us get logs from the sshd service directly through docker logs, good for troubleshooting weird ssh issues
CMD ["/usr/sbin/sshd","-D", "-e"]
CMD ["/usr/sbin/sshd","-D", "-e"]

0 comments on commit 58aa73a

Please sign in to comment.