greenhouse / hedge / hedge.189 lines · 1593B · raw
1.TH HEDGE 1 hedge 2.SH NAME 3hedge \- git access control for ssh 4.SH SYNOPSIS 5.B hedge 6.I id 7.SH DESCRIPTION 8.B hedge 9is run as the forced command of an ssh key and lets the identity 10.I id 11fetch from or push to the repositories the 12.B acl 13file grants it. 14It reads the git command from 15.BR SSH_ORIGINAL_COMMAND , 16checks it and hands it to 17.B gitshell 18as 19.IR verb " '" root / repo .git'. 20Any other command, including an interactive login, is refused. 21.P 22.B git-upload-pack 23and 24.B git-upload-archive 25need read access, 26.B git-receive-pack 27needs write access. 28Write access implies read access. 29.P 30The repository path may be quoted, may start with a slash and may end 31with a slash or 32.BR .git . 33What remains must consist of 34.BR / -separated 35segments matching 36.BR ^[A-Za-z0-9_][A-Za-z0-9._-]*$ , 37so nested repositories such as 38.B group/repo 39are allowed. 40.SH FILES 41.TP 42.B acl 43One grant per line: 44.IP 45.nf 46.IR repo " " read | write " " id 47.fi 48.IP 49Fields are separated by a single space and 50.I repo 51is written without 52.BR .git . 53There are no comments or wildcards. 54.TP 55.IR root / repo .git 56The bare repositories. 57.SH EXIT STATUS 58.TP 59.B 1 60Access was denied or 61.B gitshell 62could not be run. 63.P 64Otherwise the exit status is that of 65.BR git-shell . 66.SH EXAMPLES 67.B acl: 68.P 69.nf 70greenhouse write lostduk 71greenhouse read alice 72.fi 73.P 74.BR authorized_keys : 75.P 76.nf 77command="/usr/local/bin/hedge lostduk",restrict ssh-ed25519 AAAA... 78.fi 79.P 80Clone with 81.IR "git clone git@host:greenhouse" . 82.SH CUSTOMIZATION 83.B hedge 84is configured by editing 85.I config.h 86and recompiling. 87.SH SEE ALSO 88.BR git-shell (1), 89.BR sshd (8)