Linux: Allow git repo push over ssh without allowing shell access

If you have a git repo on a server and allow users to push over ssh using their public keys, then you might want to add this to every entry on the authorized_keys file on .ssh

For each ssh pub key on authorized_keys pre-append this


Where .gitserve is a script allowing only git commands to be executed


exec git-shell -c "$SSH_ORIGINAL_COMMAND"