2

I have a seen a lot of posts related to the error I am getting but can't find anything that seems like a potential fix I would like to try without getting feedback from some people who know better.

The Setup: I recently built a Windows 7 PC and installed Apache, PHP and MySQL. Everything is working great with my setup and I opened the server up to other devices on the LAN. When I go to a browser and navigate to IPADDRESS:PORT (Installed Apache to listen on a custom port to avoid potential conflicts (Skype, future IIS install?, etc) I get my htdocs index.php page. Great so far.

The last thing I wanted to do was setup Git so that I can do work for my server on my Macbook Pro and push changes to the server. To get this up and running I installed msysgit on my server and was able to create a Git repository for a Media directory I created at the root of my server. When I open this directory up in Explorer I can see the .git directory. The next thing I did was install OpenSSH on the server and I got that up and running. I also changed the default home directory of an SSH connection to the htdocs folder of my Apache server.

Now when I move over to my Macbook pro to test the setup and I am getting problems.

SSH seems to be functioning as expected. When I am on my laptop and run ssh USERNAME@IPADDRESS I get the message to enter my password, I enter my login password and awesome I am in the shell of my server at the htdocs directory.

Git does not seem to be functioning as easily though. I have Git on my Macbook Pro and was able to create a repository in a local directory no problem. When I navigate to a new directory in Terminal that I would like to work with the Media folder project I created on the server and run the following Git commands:

git clone USERNAME@IPADDRESS:/Media

git clone USERNAME@IPADDRESS:\Media

git clone USERNAME@IPADDRESS:/Media.git

git clone USERNAME@IPADDRESS:/Media/.git

etc

(Not sure what exact command I'm supposed to be running. Do I need .git at the end of this command? I see a hidden .git directory in the Media directory but I don't see a Media.git file.)

I get the following error:

Received disconnect from IPADDRESS: 2: fork failed: Resource temporarily unavailable fatal: The remote end hung up unexpectedly

Based on my searching I can't tell if this error is coming from my client (Macbook Pro) or server. I read that it could be a threading limit set on my Macbook so I entered the following commands and upped my maxprocperuid:

sudo sysctl -a|grep maxprocperuid (which outputted 709)

sudo sysctl -w kern.maxprocperuid=3000 (upped it to ridiculous number to see if it was the problem)

But I am still getting the error when trying to clone the repository.

If you've gotten to the end of this thanks, just trying to provide as much info as possible and any help would really be appreciated.

Thanks.

Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
GregoryLG
  • 67
  • 2
  • 8
  • What is the relative path of the `Media` directory wrt the htdocs directory? Is it within that same `htdocs` directory? In linux, if your git repo was at `/some/repo/location`, you would have to do `git clone user@address:/some/repo/location`, but in your case it is a windows path, and I am not sure how the `C:` drives etc are accounted for in Windows path. – Anshul Goyal Mar 23 '14 at 17:59
  • Hey @mu無 the Media directory is in the root so it is in htdocs (ie Apache/htdocs/Media). I also thought that this would be a potential issue and one of the reasons I changed SSH's starting directory on the server to htdocs. I am assuming after that change the SSH connection being made is starting in htdocs and could reference relative to there. – GregoryLG Mar 23 '14 at 18:41
  • 1
    Ok. [This](http://blog.chronosinteractive.com/posts/using-windows-server-host-git-repository) seems like a good tutorial. Also check out [this](http://stackoverflow.com/a/9310918/1860929) answer. – Anshul Goyal Mar 23 '14 at 18:45
  • Thanks for the links @mu無. Finally got this working. Had to uninstall OpenSSH and installed WinSSHD per your link. After that I was able to ssh into the server and clone a git repository onto my laptop. I didn't realize getting GIT and SSH up and playing nice on the server was going to be such an issue. Thanks again. – GregoryLG Mar 26 '14 at 03:32
  • Cool then. Have posted my comments as the answer. Don't forget to upvote and accept it :) – Anshul Goyal Mar 26 '14 at 08:07

2 Answers2

2

Git doesn't use ssh by default so you have to specify it when cloning

git clone ssh://[username]@[ip-address]:[port][/path/to/repo]
Holloway
  • 6,412
  • 1
  • 26
  • 33
2

Try uninstalling OpenSSH and then installing WinSSHD again. Check out this link which suggests the same.

Also, this question might be of some help to you while you are at it.

Community
  • 1
  • 1
Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186