Skip to content

Instantly share code, notes, and snippets.

@Mic92
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mic92/7b59c4b9616d19e8efdf to your computer and use it in GitHub Desktop.
Save Mic92/7b59c4b9616d19e8efdf to your computer and use it in GitHub Desktop.
Anonymous ssh access for gitolite
#/bin/sh
# save as /usr/local/bin/gitolite-anongit
# and chmod +x /usr/local/bin/gitolite-anongit
# ForceCommand may depend on the gitolite distribution
/usr/share/gitolite/gl-auth-command anongit "$@"
#/etc/passwd
git:x:999:999:git daemon user:/:/bin/bash
# copy the git user line so anongit gets the same numerical user and group id
anongit:x:999:999:git daemon user:/:/usr/local/bin/gitolite-anongit
#/etc/shadow
# empty password for anongit
anongit:$6$CzyksOHg$XLEU.cggUG9QjGkrPb3EdtyrWHcEwFJCNLP1eldVCOVEhZgg5MYJrIL0gS3.2Xarw/8GgzyICNVjh0ibUIR0j0:16373:0:99999:7:::
# /etc/ssh/sshd_config
Match User anongit
X11Forwarding no
AllowTcpForwarding no
PermitEmptyPasswords yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment