4

I had to switch from Ubuntu so that I could use Adobe Suite at full speed and now I'm finding that SSH on windows is not as unified as on linux.

So I installed msysgit and putty but I'm finding that git is having trouble using putty for SSH. (I did install msysgit on the windows path and using plink).

I am trying to add a remote on my git project now to a server on a non-standard port by using a /.ssh/config file like

Host 255.255.255.255
Port 22222

Then I add the data to my git repo:

git remote add origin [email protected]:~/git/repo

But when I try to push I get an error message.

$ git push origin master
FATAL ERROR: Network error: Connection refused
fatal: The remote end hung up unexpectedly

So then I tried just using SSH from the git console:

ssh [email protected]

Which prompts me for my private key passphrase (which it doesn't have) and when I fail at that it asks me for my SSH user password (which works).

Since I am going to disable SSH login by password I need git to start using my key correctly.

3 Answers 3

2

I have a similar workflow but use gitosis to manage the repo on my VPS.

I use the msysgit bash with the windows path and plink as you suggest above but in addition I use pagent to manage the SSH key.

To access my repos this is the order I take,

  • Open Pagent and access my key (you only enter the passphrase here once if you have one and even if you do it remembers it for the whole session).
  • Then open Git bash and add/commit/push/pull/clone as normal.

One caveat I will note is that I had to convert the key I created with the Git bash using Putty Gen (available on the same link above) so that Pagent could use it.

2
  • Don't forget to set GIT_SSH=C:\Program Files\PuTTY\plink.exe Jun 21, 2010 at 18:14
  • Not having pagent running was half my problem - thanks!
    – Xeoncross
    Jun 22, 2010 at 4:34
1

I wasn't specifying the connection string correctly.

$ git remote add test ssh://[email protected]:22222/~/git/repo

I also didn't have pagent running to manage my keys for me. ;)

0

If you can accept not having a passphrase on that key, you could removing the passphrase... otherwise this question might provide some guidance.

1
  • 1
    Thats just it, my private key doesn't have a passphrase yet it's still asking for one.
    – Xeoncross
    Jun 21, 2010 at 17:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .