diff options
| author | delusionalai <delusionalai@jnsn.dev> | 2026-11-15 13:54:36 +0000 |
|---|---|---|
| committer | delusionalai <delusionalai@jnsn.dev> | 2026-11-15 13:54:36 +0000 |
| commit | ed62c4ccf06c2c85d871a6334e3e0d82c6e4257a (patch) | |
| tree | 69897b0d2be0fab353fa4bac3bbe9cb14171da24 /sshd_config | |
| parent | cad3e5f4dff0c77c8eed020308c5bf8ffbff5964 (diff) | |
| download | git-host-ed62c4ccf06c2c85d871a6334e3e0d82c6e4257a.tar.gz git-host-ed62c4ccf06c2c85d871a6334e3e0d82c6e4257a.zip | |
The host, built around the access control executable
git-host is now the single home of the git repo configuration. The Dockerfile
grew a build stage that installs git-authz from its own repository (the
access-control / git-host-c project) via `make install`, so the image carries
the executable, its example policy and the pre-receive hook symlink, all placed
by the program's own installer rather than copied by hand.
The server configuration is the git-authz-aware set that used to live beside the
program: the entrypoint sets core.hooksPath and refuses to serve on a policy the
hook cannot use, sshd carries PermitUserEnvironment and ForceCommand so a key's
identity survives to the hook, create-repo prints the policy line to add, and
git-host-key manages keys that name their user. cgitrc keeps the corrected
ordering (repo-scoped settings above scan-path).
Diffstat (limited to 'sshd_config')
| -rw-r--r-- | sshd_config | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sshd_config b/sshd_config index 3b5c369..fca7e7b 100644 --- a/sshd_config +++ b/sshd_config @@ -3,7 +3,23 @@ ListenAddress 0.0.0.0 HostKey /run/git-host/secrets/ssh_host_ed25519_key HostKey /run/git-host/secrets/ssh_host_rsa_key PidFile /run/sshd/sshd.pid + +# One OS account for everyone; the name behind a key comes from the key itself: +# +# environment="GIT_HOST_USER=alice",command="/usr/bin/git-shell",... ssh-ed25519 ... + AuthorizedKeysFile /run/git-host/secrets/authorized_keys + +# Without this sshd silently drops the environment= option and every push arrives +# anonymous. The usual objection does not apply: there is no login shell here +# (ForceCommand below), no writable files and no user rc file. + +PermitUserEnvironment yes + +# For a hand-added key that forgot its command= option: git transport, no shell. + +ForceCommand /usr/bin/git-shell + PasswordAuthentication no KbdInteractiveAuthentication no ChallengeResponseAuthentication no |
