Browse Source

fix(gitzones): unlock git user to allow ssh-login using pubkey

Nils Wisiol 4 năm trước cách đây
mục cha
commit
beaa4fd31c
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      gitzones/Dockerfile

+ 2 - 1
gitzones/Dockerfile

@@ -4,7 +4,8 @@ RUN apk add --no-cache openssh git python3
 
 RUN adduser -D -s /usr/bin/git-shell git \
   && mkdir /home/git/.ssh \
-  && ln -s /etc/ssh/keys/git_authorized_keys /home/git/.ssh/authorized_keys
+  && ln -s /etc/ssh/keys/git_authorized_keys /home/git/.ssh/authorized_keys \
+  && passwd -u git  # sshd config prohibits passwordless login
 
 COPY git-shell-commands /home/git/
 COPY sshd_config /etc/ssh/