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

Re: ssh username environment variable

From
Chris Packham <judge.packham@gmail.com>
Date
Jan 8, 2010, 20:37 UTC
Message-ID
<a038bef51001081237h67fd421cg767403bf9f0d99df@mail.gmail.com>
In-Reply-To
<7vskag9vz0.fsf@alter.siamese.dyndns.org>
On Fri, Jan 8, 2010 at 3:34 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
>
>> Chris Packham <judge.packham@gmail.com> wrote:
>>> Just wondering if there is an environment variable I can use to tell
>>> git or ssh what user name to use for the ssh transport?
>>
>> No.  But you can hack around it:
>>
>>   cat >$HOME/bin/git-ssh
>>   #!/bin/sh
>>   ssh -l $GIT_SSH_USER "$@"
>>   ^D
>>
>>   GIT_SSH=$HOME/bin/git-ssh GIT_SSH_USER=myname git clone ...
>
> I thought the standard answer was "use $HOME/.ssh/config", to set User
> by keying on the remote hostname to which you are going.
>
Yeah thats what I've done after reading a few more man pages.
Previous: Junio C Hamano
Message 4 of 4 in “ssh username environment variable”
  1. Chris PackhamJan 8, 2010
  2. Shawn O. PearceJan 8, 2010
  3. Junio C HamanoJan 8, 2010
  4. Chris PackhamJan 8, 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.