shell doc: emphasize purpose and security model
[alt-git.git] / Documentation / git-shell.txt
blob544b21aaa6d0c52d40ec1bfd53ac894db0961bab
1 git-shell(1)
2 ============
4 NAME
5 ----
6 git-shell - Restricted login shell for Git-only SSH access
9 SYNOPSIS
10 --------
11 [verse]
12 'chsh' -s $(command -v git-shell) <user>
13 'git clone' <user>`@localhost:/path/to/repo.git`
14 'ssh' <user>`@localhost`
16 DESCRIPTION
17 -----------
19 This is a login shell for SSH accounts to provide restricted Git access.
20 It permits execution only of server-side Git commands implementing the
21 pull/push functionality, plus custom commands present in a subdirectory
22 named `git-shell-commands` in the user's home directory.
24 COMMANDS
25 --------
27 'git shell' accepts the following commands after the '-c' option:
29 'git receive-pack <argument>'::
30 'git upload-pack <argument>'::
31 'git upload-archive <argument>'::
32         Call the corresponding server-side command to support
33         the client's 'git push', 'git fetch', or 'git archive --remote'
34         request.
35 'cvs server'::
36         Imitate a CVS server.  See linkgit:git-cvsserver[1].
38 If a `~/git-shell-commands` directory is present, 'git shell' will
39 also handle other, custom commands by running
40 "`git-shell-commands/<command> <arguments>`" from the user's home
41 directory.
43 INTERACTIVE USE
44 ---------------
46 By default, the commands above can be executed only with the '-c'
47 option; the shell is not interactive.
49 If a `~/git-shell-commands` directory is present, 'git shell'
50 can also be run interactively (with no arguments).  If a `help`
51 command is present in the `git-shell-commands` directory, it is
52 run to provide the user with an overview of allowed actions.  Then a
53 "git> " prompt is presented at which one can enter any of the
54 commands from the `git-shell-commands` directory, or `exit` to close
55 the connection.
57 Generally this mode is used as an administrative interface to allow
58 users to list repositories they have access to, create, delete, or
59 rename repositories, or change repository descriptions and
60 permissions.
62 SEE ALSO
63 --------
64 ssh(1),
65 linkgit:git-daemon[1],
66 contrib/git-shell-commands/README
68 GIT
69 ---
70 Part of the linkgit:git[1] suite