summaryrefslogtreecommitdiff
path: root/git-server
diff options
context:
space:
mode:
Diffstat (limited to 'git-server')
-rw-r--r--git-server/Dockerfile2
-rw-r--r--git-server/sshd_config5
2 files changed, 4 insertions, 3 deletions
diff --git a/git-server/Dockerfile b/git-server/Dockerfile
index 580c78d..85fd796 100644
--- a/git-server/Dockerfile
+++ b/git-server/Dockerfile
@@ -16,7 +16,7 @@ RUN mkdir /git-server/keys \
# 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 \
+ && usermod -p '*' -d /repos git \
# git-shell must be in /etc/shells or OpenSSH rejects login
&& echo /usr/bin/git-shell >> /etc/shells \
&& mkdir /home/git/.ssh
diff --git a/git-server/sshd_config b/git-server/sshd_config
index 102169d..d982b37 100644
--- a/git-server/sshd_config
+++ b/git-server/sshd_config
@@ -51,8 +51,9 @@ PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
-AuthorizedKeysFile .ssh/authorized_keys
-#AuthorizedKeysFile /home/git/.ssh/authorized_keys
+# Absolute path because git user home is /repos (for shorter clone URLs),
+# but .ssh stays at /home/git/.ssh/ to keep it out of the repos volume
+AuthorizedKeysFile /home/git/.ssh/authorized_keys
#AuthorizedPrincipalsFile none