2

Every time I want to use a normal git server with a clone URL of the form git@..., the request times out. I think this is due to some firewall on my Mac, but I am sure that I have turned everything off.

The standard firewall that you can configure in 'System Preferences' is turned off. I run little snitch, but for testing purposes I also turned this off. I turned off pfctl (also just during testing), but I still can’t access any remote git server.

The only option I have at the moment is with servers that offer git over HTTPS.

Anyone has an idea?

Greg Bacon
  • 134,834
  • 32
  • 188
  • 245
Nils Ziehn
  • 4,118
  • 6
  • 26
  • 40
  • Stackoverflow is for programming-related question. Please http://apple.stackexchange.com – trojanfoe Nov 12 '13 at 17:35
  • 3
    @trojanfoe: questions about tools used by programmers, including git, are on-topic for SO. – Wooble Nov 12 '13 at 17:36
  • What is the output of running `ssh git@host`, where *host* is the machine where your repository lives? – Greg Bacon Nov 12 '13 at 17:40
  • 2
    @trojanfoe I disagree, one of the most popular question here is about Git http://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git – meda Nov 12 '13 at 17:40
  • Thx for defending my question guys ;) ssh git@host runs and never stops (no matter what I put for host) – Nils Ziehn Nov 12 '13 at 17:49
  • 1
    @meda and wooble While, of course, the use of git is very much on-topic, problems relating to network issues are not. This question falls into that latter area. While this is only advice, the OP will get much more relevant attention on one of the other sites. – trojanfoe Nov 12 '13 at 19:20

1 Answers1

2

Assuming an errror message similar to:

ssh: connect to host xxx port 22: Operation timed out

The usual commands to debug this are (as mentioned in "SSH request timeout every time"):

ping host
traceroute host
ssh -v git@host

However, do check if you have a proxy in place.

Usually, a proxy block outgoing request on port 22.

Other debug tips are available in this thread

ssh -2 -o ConnectTimeout=1 -v -l user host_ip -p 22

That thread highlight a port number issue (which shouldn't be the issue here).
It also mentions:

Primary reason for slow initial connection to SSH is, ssh does a reverse dns lookup on your IP. If one is set, or your authoritive server is really slow, you have to wait for it to time out.
Once connected, though, everything is normal. Until you close and connect again.

I've also seen this cause by either no, or bad name servers in /etc/resolve.conf.


In the case of the OP Nils Ziehn, he comments:

my ssh config file was broken

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thx for your answer! This actually helped me find my problem: my ssh config file was broken, but for some reason it didnt throw any errors but just timeout every time. – Nils Ziehn Nov 13 '13 at 12:36
  • @NilsZiehn great! I have included your conclusion in the answer for more visibility. – VonC Nov 13 '13 at 12:39