git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Allow git-shell to be used as a ssh forced-command

From
Mike Hommey <mh@glandium.org>
Date
Apr 17, 2009, 22:36 UTC
Message-ID
<20090417223649.GA1881@glandium.org>
In-Reply-To
<37fcd2780904171400uf9d1f36g4d24e02aebf6ac3f@mail.gmail.com>
On Sat, Apr 18, 2009 at 01:00:35AM +0400, Dmitry Potapov wrote:
Show 20 quoted lines
> On Fri, Apr 17, 2009 at 09:49:19PM +0200, Mike Hommey wrote:
> > On Fri, Apr 17, 2009 at 08:24:35PM +0400, Dmitry Potapov wrote:
> > > On Thu, Apr 16, 2009 at 11:10:56PM +0200, Mike Hommey wrote:
> > > > When using a forced-command, OpenSSH sets the SSH_ORIGINAL_COMMAND
> > > > variable to what would otherwise be passed to $SHELL -c. When this
> > > > variable is set, we use it instead of the contents of argv.
> > >_
> > > It would be nice to provide some justification where it can be used.
> > > IOW, why do you want to have the force command where essentially
> > > you execute the original command as it were no force-command?
> >_
> > You're not executing any command, but only what git-shell allows.
> > This allows git-shell to be set as a forced-command for a specific
> > ssh key, for example.
> 
> Would it better to set git-shell as the login shell for this account?
> IMHO, that provides better security than using a forced-command, and
> that is how git-shell is intended to use. So, I am not sure what are
> benefits of using a forced-command when it just executes the original
> command using git-shell.

You may want to provide other kind of accesses for the same account. Also, an unpriviledged user would be able to, without root access, setup write access to his private git repositories via forced-commands for given ssh keys.

> Besides, you made SSH_ORIGINAL_COMMAND to take precedent over explicitly
> specified parameters given to git-shell. Maybe it should be the other
> way around?

If SSH_ORIGINAL_COMMAND is set, which means forced-commands are in use, I don't see why other parameters should be more important.

Mike
Previous: Dmitry PotapovNext: Shawn O. Pearce
Message 5 of 18 in “Allow git-shell to be used as a ssh forced-command”
  1. Allow git-shell to be used as a ssh forced-commandMike Hommey, Apr 16, 2009
  2. Dmitry PotapovApr 17, 2009
  3. Mike HommeyApr 17, 2009
  4. Dmitry PotapovApr 17, 2009
  5. Mike HommeyApr 17, 2009
  6. Shawn O. PearceApr 17, 2009
  7. Mike HommeyApr 17, 2009
  8. Matthieu MoyApr 18, 2009
  9. Junio C HamanoApr 17, 2009
  10. Tommi VirtanenApr 17, 2009
  11. Junio C HamanoApr 18, 2009
  12. Mike HommeyApr 18, 2009
  13. Allow git-shell to be used as a ssh forced-commandMike Hommey, Apr 21, 2009
  14. Dmitry PotapovApr 21, 2009
  15. Eygene RyabinkinApr 21, 2009
  16. Junio C HamanoApr 21, 2009
  17. Mike HommeyApr 21, 2009
  18. Dmitry PotapovApr 21, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.