Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I asked this first on StackOverflow and I was suggested that I should ask it here:

We have a self hosted git server (Gitolite) on a VPS account (CPU:2.68GHz RAM:1824MB). This same VPS is also used to publish our underdevelopment web apps for client demos. (Very little traffic). so the main use of the server is as a Git Server Only.

This git server is accessed by a team of 30-40 people for various projects. Our problem is that during the day when 6-7 people are trying to access the server (sometimes same repo) we get frequent error message:

ssh: connect to host port 22: Bad file number fatal: The remote end hung up unexpectedly

After trying for 10-15 minutes it generally succeeds.

During early mornings and late nights when there are only 1-2 people, git commands work with 100% success rate. Also I would like to note that if I access the other file hosted on the server through HTTP it works fine.

I found a couple of questions on StackOverflow and on other sites regarding this. But most of the people point towards SSH key set up or conflicts between Msysgit and Cygns SSH.

However I don't think this is the problem in our case as we get this behavior on Windows (using msysgit only) as well as Mac Machines. Also if it was SSH configuration issue then it shouldn't work at all. But in our case it works after 10-15 minutes.

I think in our case it might be too many simultaneous connections to same server (or same repo) or something like that. Does there exists a setting or a conf file that needs to modified to solve this problem?

Please help me solve this problem or point me in the right direction.

Thanks in advance.


share|improve this question

This is a total shot in the dark, but I've found this often happens when the SSH server provides output that's unexpected before giving an interactive shell -- in my case, it was something I put in my .bash_profile that notified me if I had existing screen sessions running. Do you have anything in your login script that might be writing to stdout/stderr?

share|improve this answer

Remember, you're just using SSH to connect to the the git server to transfer the data. There's actually a post on github about this issue specifically, which indicates firewalls and/or proxies are to be blamed for the issue you're experiencing.

share|improve this answer
Link goes to Guthub's contact page, and not to a specific post. – Kevin M Jul 29 '11 at 15:51
Hm, I notice that... that's very strange. It looks like the initial post has all but disappeared, and I can't even find it anymore... – Andrew M. Aug 1 '11 at 2:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.