summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git-server/Dockerfile6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-server/Dockerfile b/git-server/Dockerfile
index 3fdf26b..580c78d 100644
--- a/git-server/Dockerfile
+++ b/git-server/Dockerfile
@@ -12,6 +12,12 @@ WORKDIR /git-server/
# -s flag changes user's shell
RUN mkdir /git-server/keys \
&& adduser --disabled-password --shell /usr/bin/git-shell git \
+ # Set password to '*' to unlock the account for SSH key auth.
+ # adduser --disabled-password sets '!' which OpenSSH 10.0 treats as locked,
+ # rejecting even valid pubkey logins. '*' means "no password login possible"
+ # but the account is not locked.
+ && usermod -p '*' git \
+ # git-shell must be in /etc/shells or OpenSSH rejects login
&& echo /usr/bin/git-shell >> /etc/shells \
&& mkdir /home/git/.ssh