summaryrefslogtreecommitdiffstats
path: root/git-shell.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-03-21 15:49:01 -0700
committerJunio C Hamano <gitster@pobox.com>2013-03-21 15:49:01 -0700
commit5e7f131ec750093b9c1691ff92db43b0595ea98c (patch)
tree336c153c1aecfeab7cab7cf3502a7ffe0a6d7d6f /git-shell.html
parent947ab826679af3ad71f1bd69391deca3bc6edad9 (diff)
downloadgit-htmldocs-5e7f131ec750093b9c1691ff92db43b0595ea98c.tar.gz
Autogenerated HTML docs for v1.8.2-135-g7b592
Diffstat (limited to 'git-shell.html')
-rw-r--r--git-shell.html105
1 files changed, 91 insertions, 14 deletions
diff --git a/git-shell.html b/git-shell.html
index 67ce35042..4eb793629 100644
--- a/git-shell.html
+++ b/git-shell.html
@@ -746,7 +746,9 @@ git-shell(1) Manual Page
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="verseblock">
-<pre class="content"><em>git shell</em> [-c &lt;command&gt; &lt;argument&gt;]</pre>
+<pre class="content"><em>chsh</em> -s $(command -v git-shell) &lt;user&gt;
+<em>git clone</em> &lt;user&gt;<code>@localhost:/path/to/repo.git</code>
+<em>ssh</em> &lt;user&gt;<code>@localhost</code></pre>
<div class="attribution">
</div></div>
</div>
@@ -754,18 +756,93 @@ git-shell(1) Manual Page
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
-<div class="paragraph"><p>A login shell for SSH accounts to provide restricted Git access. When
-<em>-c</em> is given, the program executes &lt;command&gt; non-interactively;
-&lt;command&gt; can be one of <em>git receive-pack</em>, <em>git upload-pack</em>, <em>git
-upload-archive</em>, <em>cvs server</em>, or a command in COMMAND_DIR. The shell
-is started in interactive mode when no arguments are given; in this
-case, COMMAND_DIR must exist, and any of the executables in it can be
-invoked.</p></div>
-<div class="paragraph"><p><em>cvs server</em> is a special command which executes git-cvsserver.</p></div>
-<div class="paragraph"><p>COMMAND_DIR is the path "$HOME/git-shell-commands". The user must have
-read and execute permissions to the directory in order to execute the
-programs in it. The programs are executed with a cwd of $HOME, and
-&lt;argument&gt; is parsed as a command-line string.</p></div>
+<div class="paragraph"><p>This is a login shell for SSH accounts to provide restricted Git access.
+It permits execution only of server-side Git commands implementing the
+pull/push functionality, plus custom commands present in a subdirectory
+named <code>git-shell-commands</code> in the user&#8217;s home directory.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_commands">COMMANDS</h2>
+<div class="sectionbody">
+<div class="paragraph"><p><em>git shell</em> accepts the following commands after the <em>-c</em> option:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<em>git receive-pack &lt;argument&gt;</em>
+</dt>
+<dt class="hdlist1">
+<em>git upload-pack &lt;argument&gt;</em>
+</dt>
+<dt class="hdlist1">
+<em>git upload-archive &lt;argument&gt;</em>
+</dt>
+<dd>
+<p>
+ Call the corresponding server-side command to support
+ the client&#8217;s <em>git push</em>, <em>git fetch</em>, or <em>git archive --remote</em>
+ request.
+</p>
+</dd>
+<dt class="hdlist1">
+<em>cvs server</em>
+</dt>
+<dd>
+<p>
+ Imitate a CVS server. See <a href="git-cvsserver.html">git-cvsserver(1)</a>.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>If a <code>~/git-shell-commands</code> directory is present, <em>git shell</em> will
+also handle other, custom commands by running
+"<code>git-shell-commands/&lt;command&gt; &lt;arguments&gt;</code>" from the user&#8217;s home
+directory.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_interactive_use">INTERACTIVE USE</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>By default, the commands above can be executed only with the <em>-c</em>
+option; the shell is not interactive.</p></div>
+<div class="paragraph"><p>If a <code>~/git-shell-commands</code> directory is present, <em>git shell</em>
+can also be run interactively (with no arguments). If a <code>help</code>
+command is present in the <code>git-shell-commands</code> directory, it is
+run to provide the user with an overview of allowed actions. Then a
+"git&gt; " prompt is presented at which one can enter any of the
+commands from the <code>git-shell-commands</code> directory, or <code>exit</code> to close
+the connection.</p></div>
+<div class="paragraph"><p>Generally this mode is used as an administrative interface to allow
+users to list repositories they have access to, create, delete, or
+rename repositories, or change repository descriptions and
+permissions.</p></div>
+<div class="paragraph"><p>If a <code>no-interactive-login</code> command exists, then it is run and the
+interactive shell is aborted.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_example">EXAMPLE</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>To disable interactive logins, displaying a greeting instead:</p></div>
+<div class="paragraph"><p>+</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>$ chsh -s /usr/bin/git-shell
+$ mkdir $HOME/git-shell-commands
+$ cat &gt;$HOME/git-shell-commands/no-interactive-login &lt;&lt;\EOF
+#!/bin/sh
+printf '%s\n' "Hi $USER! You've successfully authenticated, but I do not"
+printf '%s\n' "provide interactive shell access."
+exit 128
+EOF
+$ chmod +x $HOME/git-shell-commands/no-interactive-login</code></pre>
+</div></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_see_also">SEE ALSO</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>ssh(1),
+<a href="git-daemon.html">git-daemon(1)</a>,
+contrib/git-shell-commands/README</p></div>
</div>
</div>
<div class="sect1">
@@ -778,7 +855,7 @@ programs in it. The programs are executed with a cwd of $HOME, and
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2011-11-15 13:45:02 PST
+Last updated 2013-03-21 15:47:21 PDT
</div>
</div>
</body>