From 58aa73a1836f0c1cc5020c3e49750ba9510b3b87 Mon Sep 17 00:00:00 2001 From: mbmcmullen27 <68041054+mbmcmullen27@users.noreply.github.com> Date: Fri, 10 Nov 2023 20:50:00 -0600 Subject: [PATCH] Update Dockerfile set sshd_config --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4041f04..beeb3dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/ @@ -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"] \ No newline at end of file +CMD ["/usr/sbin/sshd","-D", "-e"]