summaryrefslogtreecommitdiffstats
path: root/container/sshd_config
diff options
context:
space:
mode:
authordev <dev@example>2026-11-14 01:05:08 +0000
committerdev <dev@example>2026-11-14 01:05:08 +0000
commit312ddd4936f09ae27a180ca495cacf2c06faf33e (patch)
tree2fa46ab568ad55f7e8fb844c3447b1d296b2e340 /container/sshd_config
parente737f3d560de2b8172e6dd83901bc1359283303c (diff)
downloadaccess-control-312ddd4936f09ae27a180ca495cacf2c06faf33e.tar.gz
access-control-312ddd4936f09ae27a180ca495cacf2c06faf33e.zip
Comments: cut to what the code cannot say
The comments had grown into essays. A file header explaining why the file exists, then a paragraph above each function restating what the next eight lines do, then a paragraph above that one explaining why that matters. The reader gets no further than the first paragraph, and the second is the one that goes stale: it describes code that has since changed, and nothing fails when it does. Cut by about half. What is left is the three things a comment can do that code cannot: say why the constraint exists (no regex because a hook must not depend on what might be missing at 3am), say what is not obvious from the shape (a bare ref name is a branch, never a tag; the seventh field of /etc/passwd is the shell), and say where it hurts (the NULL in an execvp array, the mode and owner that have to survive an atomic rewrite, the child that must not keep the hook's stdin). Block comments became // lines, which is also what the other C trees here use, and the file headers went to two or three lines. Section banners stayed: they are navigation, not prose. Behaviour is unchanged and the suites prove it: 171 direct checks, 162 behavioural, clean under -Werror and under ASan/UBSan.
Diffstat (limited to 'container/sshd_config')
-rw-r--r--container/sshd_config16
1 files changed, 7 insertions, 9 deletions
diff --git a/container/sshd_config b/container/sshd_config
index c180f50..fca7e7b 100644
--- a/container/sshd_config
+++ b/container/sshd_config
@@ -4,22 +4,20 @@ 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. git-host-key writes
+# 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 ...
-#
-# and git-authz reads GIT_HOST_USER out of the push environment.
+
AuthorizedKeysFile /run/git-host/secrets/authorized_keys
-# Without this line sshd silently drops the environment= key option, every
-# connection arrives anonymous, and every push is denied. The usual objection
-# does not apply here: the git account has no login shell worth having
+# 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
-# Belt and braces for a hand-added key that forgot its command= option: nobody
-# gets a shell, only the git transport.
+# For a hand-added key that forgot its command= option: git transport, no shell.
+
ForceCommand /usr/bin/git-shell
PasswordAuthentication no