can't talk to git over ssh... (still newbie)

504 views
Skip to first unread message

Emmanuel Grumbach

unread,
Oct 13, 2009, 4:42:53 AM10/13/09
to Repo and Gerrit Discussion
Hi,

I can ssh -p 29418 my server without any issue:

[egrumbac@jrlmcp01 egrumbac]$ ssh -p29418 egru...@cook.DOMAIN.com
gerrit ls-projects
test/project
[egrumbac@jrlmcp01 egrumbac]$

but can't push / pull:

[egrumbac@jrlmcp01 egrumbac]$ git clone ssh://egru...@cook.DOMAIN.com29418/test/project
Initialized empty Git repository in /vol/work/users/egrumbac/
project/.git/
ssh: Could not resolve hostname cook.DOMAIN.com:29418: Name or service
not known
fatal: The remote end hung up unexpectedly
fetch-pack from 'ssh://egru...@cook.DOMAIN.com:29418/test/project'
failed.

The "funny" thing is that if I give my keys to the gerrit user and run
the exact same command (connect to the gerrit server as egrumbac to
match the SSH username I gave to gerrit web UI), then it works... So
it must be a stupid .ssh/something issue. But I just can't figure out
which one... my .ssh/known_host are the same for both users, and
shouldn't raise any issue anyway,

All the commands (whatever user I use: egrumbac or gerrit) are run
from the gerrit server itself: cook.DOMAIN.com

Note that it worked once and I don't see what I could have done that
broke everything.

Thanks in advance.

Shawn Pearce

unread,
Oct 13, 2009, 10:33:20 AM10/13/09
to repo-d...@googlegroups.com
On Tue, Oct 13, 2009 at 01:42, Emmanuel Grumbach <egru...@gmail.com> wrote:
> I can ssh -p 29418 my server without any issue:
> but can't push / pull:
>
> [egrumbac@jrlmcp01 egrumbac]$ git clone ssh://egru...@cook.DOMAIN.com29418/test/project
> Initialized empty Git repository in /vol/work/users/egrumbac/
> project/.git/
> ssh: Could not resolve hostname cook.DOMAIN.com:29418: Name or service
> not known

Your git version is too old. Upgrade. :-)

Extracting the port number from the ssh:// URL and passing it as the
-p option to ssh was introduced in git 1.5.3. You must be running
something older than that.

If you can't upgrade, you can leave the port off the URL and set it
via ~/.ssh/config:

Host review
Hostname cook.DOMAIN.com
Port 29418

git clone ssh://egrumbac@review/test/project

Emmanuel Grumbach

unread,
Oct 13, 2009, 10:56:22 AM10/13/09
to Repo and Gerrit Discussion



> Your git version is too old.  Upgrade.  :-)

git --version
git version 1.5.3.rc5

but

>   Host review
>     Hostname cook.DOMAIN.com
>     Port 29418
>
>   git clone ssh://egrumbac@review/test/project

This worked.

Thanks !

Shawn Pearce

unread,
Oct 13, 2009, 11:00:07 AM10/13/09
to repo-d...@googlegroups.com
On Tue, Oct 13, 2009 at 07:56, Emmanuel Grumbach <egru...@gmail.com> wrote:
>> Your git version is too old.  Upgrade.  :-)
>
> git --version
> git version 1.5.3.rc5

The commit that added the SSH port number into ssh:// URLs came in
after rc5, but was included in 1.5.3 anyway. :-)

Git rc period doesn't necessarily mean new features weren't added
*during* the rc period. Its just very uncommon. The SSH port number
patch was pretty trivial, and back then Junio was a bit more
aggressive about taking obvious new functionality during an rc period.
This has become less common in the 1.6 series... now post-rc its
usually only bug fixes.

Reply all
Reply to author
Forward
0 new messages