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

Re: git + ssh + key authentication feature-request

From
MWMark Wooding <mdw@distorted.org.uk>
Date
Feb 9, 2006, 00:14 UTC
Message-ID
<slrndul2bq.2i8.mdw@metalzone.distorted.org.uk>
In-Reply-To
<7v4q39o3xs.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 5 quoted lines
> So while you could make a repository "/pub/project.git" the home
> directory of _one_ UNIX user, and store her key in the file
> "/pub/project.git/.ssh/authorized_keys", that would not work
> very well for a shared repository setup if you want to be able
> to tell more than one physical users apart.

Ahh! But you can. The trick is to set the remote user's identity based on the key he uses to authenticate himself. This doesn't work if you use password authentication. You add items of the form `environment="VAR=VALUE"' to the end of each authorized_keys entry, as appropriate for whoever it is that owns the corresponding private key; the GIT_{AUTHOR,COMMITTER}_{NAME,EMAIL} variables are ideal choices to set here. You could set some other variables and do some more sophisticated checking of who's doing what, which would require souping up git-daemon somewhat, but I don't think it's beyond the realms of possibility.

It's important that your users can't use this SSH access to mess with the shared user's SSH configuration itself, but, hey, that sort of restricted access is what git-daemon is for, right?

> You _could_ tell them to use the same -l option and log-in as the same
> UNIX user with their own keys, though.  But that way you cannot tell
> which developer pushed into the repository (of course if you trust the
> commits, commit log message would say the committer ident).

I think the problem there is more that the commits themselves were created elsewhere, where this server wasn't watching, and therefore it pretty much has to take the committer and author information there on trust.

-- [mdw]
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 15 in “git + ssh + key authentication feature-request”
  1. Nicolas Vilz 'niv'Feb 8, 2006
  2. Junio C HamanoFeb 8, 2006
  3. Nicolas Vilz 'niv'Feb 8, 2006
  4. Linus TorvaldsFeb 8, 2006
  5. Nicolas Vilz 'niv'Feb 9, 2006
  6. Junio C HamanoFeb 8, 2006
  7. Mark WoodingFeb 9, 2006
  8. Junio C HamanoFeb 9, 2006
  9. Mark WoodingFeb 9, 2006
  10. Nicolas Vilz 'niv'Feb 9, 2006
  11. Linus TorvaldsFeb 8, 2006
  12. Nicolas Vilz 'niv'Feb 9, 2006
  13. Junio C HamanoFeb 8, 2006
  14. Nicolas Vilz 'niv'Feb 9, 2006
  15. Alan ChandlerFeb 8, 2006

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.