Jonathan Nieder <> writes:

> diff --git a/Documentation/git-shell.txt b/Documentation/git-shell.txt
> index 4fe93203..60051e63 100644
> --- a/Documentation/git-shell.txt
> +++ b/Documentation/git-shell.txt
> @@ -59,6 +59,26 @@ users to list repositories they have access to, create, 
> delete, or
>  rename repositories, or change repository descriptions and
>  permissions.
> +If the `help` command exists and exits with nonzero status, the
> +interactive shell is aborted.
> +
> +-------
> +
> +To disable interactive logins, displaying a greeting instead:
> ++
> +----------------
> +$ chsh -s /usr/bin/git-shell
> +$ mkdir $HOME/git-shell-commands
> +$ cat >$HOME/git-shell-commands/help <<\EOF
> +#!/bin/sh
> +printf '%s\n' "Hi $USER! You've successfully authenticated, but I do not"

Where in the sshd to git-shell exec chain is $USER variable set for
the user?  Just being curious if this is the simplest but one of the
more robust ways to get the user's name.

I still think forcing the site administrator create a directory for
each and every user only to house a single script that denies the
access is a wrong design, but the code seems to correctly implement
that design.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to