Created
January 9, 2012 16:44
-
-
Save presbrey/1583792 to your computer and use it in GitHub Desktop.
gitosis gssapi wrapper: map kerberos principal to gitosis user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# gitosis-serve-krb5 | |
# | |
# map kerberos principal to gitosis user (and strip @REALM.COM) | |
# | |
# [/etc/ssh/sshd_config] | |
# Match User git | |
# ForceCommand gitosis-serve-krb5 | |
klist=`klist -5` | |
if [[ $? -eq 0 ]]; then | |
user=`klist -5 2>/dev/null | awk '/Default principal:/ {print $3}' | cut -d@ -f1` | |
if [[ ! -z "$user" ]]; then | |
exec gitosis-serve $user | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment