Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a git repo I am trying to use this command on a remote.

$ git push origin master
ssh: connect to host  port 22: Bad file number
fatal: The remote end hung up unexpectedly.

I am trying to do this with GitBash.

I generally login with ssh ONLY through Putty, so I know my key works and is there. What do I need to do to fix this?

share|improve this question
1  
What does .git/config say about your remote origin? –  Handyman5 Jul 7 '11 at 1:11
    
Not sure why this is happening, but the "host" is a blank space. –  DerfK Jul 7 '11 at 1:40
    
Missing info would be the contents of git remote show origin; we don't now where you're trying to push. –  Andrew M. Jul 11 '11 at 3:40
    
Which OS are you running the client on? Which OS is the server running on? –  kasperd Aug 31 at 9:52

2 Answers 2

http://stackoverflow.com/questions/4399106/pushing-to-github-from-work-bad-file-number-error has an accepted answer that suggests that the problem can be caused by trying to push through a proxy. How exactly that works with SSH I'm not sure, but since the answer is accepted I'd expect that the problem there was a proxy, and fixing it or removing it from the equation solved the problem.

share|improve this answer
    
No proxy, This is totally with a local network. –  mike628 Jul 9 '11 at 0:30
    
I can log into the machine with my Putty and id_sha keys. But I get this:Permission denied (publickey). fatal: The remote end hung up unexpectedly when I try to use git bash. –  mike628 Jul 9 '11 at 15:25
    
Why are you adding information pertinent to your question in a comment to my answer? Edit your question. –  womble Jul 9 '11 at 21:41

No proxy, This is totally with a local network.

Please post the output of git config -l, or at least git config --get http.proxy?

I can log into the machine with my Putty and id_sha keys. But I get this: Permission denied (publickey). fatal: The remote end hung up unexpectedly when I try to use git bash.

Did you take a look at the sshd logs?

Anyway, use HTTP to push to see what happens:

# git remote rm origin
# git remote add origin https://git.domain.com/project/repo.git
# git config --global http.sslVerify false
# git push origin master
share|improve this answer

Your Answer

 
discard

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.