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

Re: [http] Git error messages reveal password encoded in the URL

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 20, 2010, 00:41 UTC
Message-ID
<201007200241.46972.jnareb@gmail.com>
In-Reply-To
<4C44DEF7.4000903@gmail.com>
Dnia wtorek 20. lipca 2010 01:25, Ketan Padegaonkar napisał:
Show 13 quoted lines
> On 7/19/10 2:16 PM, Jacob Helwig wrote:
>> On Mon, Jul 19, 2010 at 14:10, Jakub Narebski<jnareb@gmail.com>  wrote:
>>> Dnia poniedziałek 19. lipca 2010 23:05, Jacob Helwig napisał:
>>>> On Mon, Jul 19, 2010 at 14:02, Jakub Narebski<jnareb@gmail.com>  wrote:
>>>>> Ketan Padegaonkar<ketanpadegaonkar@gmail.com>  writes:
>>>>>
>>>>>> We use http to serve our git repos, in order for git to not ask me a
>>>>>> username/password everytime,
> 
> Apologies. I used the wrong punctuation. It should read as:
> 
> We use https+basic auth to serve up git repos. Unfortunately SSH is not 
> an option for various reasons.

Is it because of firewall, or it is the issue with issuing shell accounts? If the latter, you can use tools such as gitosis or gitolite which need only one single shell account, and control access via public key infrastructure.

> 
> In order for git to not ask me the username/password, I 'encoded' the 
> username/password into the url.

Can't you use ~/.netrc file[1] instead? As far as I see this would not show password info on error. Not that the current situation should not be fixed, but it might be worthwhile workaround for a time.

The ~/.netrc file would look like this for your example:
  machine host
  login user
  password pass
You should of course `chmod 600 ~/.netrc`

[1] This is unfortunately underdocumented: only this documentation Documentation/howto/setup-git-server-over-http.txt mentions ~/.netrc file. I think that handling the $HOME/.netrc is done by the curl library that git uses, see libcurl-tutorial(3) manpage.

> I'm using git v1.7.1.1 on MacOSX Leopard. I can see the same behavior on 
> master (rev 24e7a5).
-- 
Jakub Narebski
Poland
Previous: Ketan PadegaonkarNext: Tay Ray Chuan
Message 7 of 8 in “[http] Git error messages reveal password encoded in the URL”
  1. Ketan PadegaonkarJul 19, 2010
  2. Jakub NarebskiJul 19, 2010
  3. Jacob HelwigJul 19, 2010
  4. Jakub NarebskiJul 19, 2010
  5. Jacob HelwigJul 19, 2010
  6. Ketan PadegaonkarJul 19, 2010
  7. Jakub NarebskiJul 20, 2010
  8. Tay Ray ChuanJul 20, 2010

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.