3

Some facts:

  • I'm on Windows 10
  • I'm using Power Shell with PoshGit (I don't want to use the cygwin bash shell or any derivative thereof)
  • My repositories are all git@..., i.e. they don't use https remotes
  • When I start a new shell session, if not already running, ssh-agent starts up and prompts me for my password, then stays resident for subsequent sessions
  • I have confirmed that ssh-agent is running in the background
  • my id_rsa file is present in the list of saved identities (ssh-add -l) and that is the key file I'm prompted to enter a password for when connecting to a github repository
  • I've also tried github's help page suggestion, specifically: git config --global credential.helper wincred - it didn't do anything.

Not one tutorial or bit of advice I've been able to find has been able to stop ssh from asking for my password every time I push/pull/etc.

Any help would be appreciated.

Edit

For context, Scott Haack's old article about how this is supposed to work (though apparently not for me): http://haacked.com/archive/2011/12/19/get-git-for-windows.aspx/

Edit

ssh -vvvT git@github.com verify generates this (relevant snippet):

OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007                 
debug1: Reading configuration data /etc/ssh/ssh_config    
debug2: ssh_connect: needpriv 0                           
debug1: Connecting to github.com [192.30.252.130] port 22.
debug1: Connection established.                           
debug1: identity file /c/Users/xxxxx/.ssh/identity type -1
debug3: Not a RSA1 key file /c/Users/xxxxx/.ssh/id_rsa.   
debug2: key_type_from_name: unknown key type '-----BEGIN' 
debug3: key_read: missing keytype                         
debug2: key_type_from_name: unknown key type 'Proc-Type:' 
debug3: key_read: missing keytype                         
debug2: key_type_from_name: unknown key type 'DEK-Info:'  

I removed and readded my key file and was prompted for a password:

D:\> ssh-add -D 
All identities removed.
D:\> ssh-add ~/.ssh/id_rsa
Enter passphrase for /c/Users/xxxxx/.ssh/id_rsa:
Identity added: /c/Users/xxxxx/.ssh/id_rsa (/c/Users/xxxxx/.ssh/id_rsa)
D:\> ssh-add -l 
2048 05:d5:8f:f8:e5:41:66:90:4c:a1:03:93:9d:e5:18:10 /c/Users/xxxxx/.ssh/id_rsa (RSA)

Private key file looks like this (private details removed, obviously):

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,xxxxxxxxxxxxxxxx

............etc.==
-----END RSA PRIVATE KEY-----

No idea why it's adding it one way and then getting confused when it tries to read it back.

Edit

As per comments and the accepted answer, my PATH pointed at a very outdated bin folder containing the ssh-agent and ssh-add that I was using (not to mention keygen). Fixing that, generating a new key, and pointing PATH at the correct, updated git bin folder has solved the problem.

Nathan Ridley
  • 33,766
  • 35
  • 123
  • 197
  • is it asking for your Windows password or Github password? – TheGeorgeous Feb 25 '16 at 01:55
  • `Enter passphrase for key '/c/Users/*******/.ssh/id_rsa':` – Nathan Ridley Feb 25 '16 at 01:55
  • @TheGeorgeous neither. I'm using private key authentication via ssh, which is the standard/recommended way to do things. – Nathan Ridley Feb 25 '16 at 01:56
  • it's common in *nix systems when you don't have sufficient permissions. See http://unix.stackexchange.com/questions/36540/why-am-i-still-getting-a-password-prompt-with-ssh-with-public-key-authentication – TheGeorgeous Feb 25 '16 at 01:59
  • @TheGeorgeous not a permissions issue in this case... – Nathan Ridley Feb 25 '16 at 02:22
  • @kjo thanks for the reply, but I suggest you reread my bullet points... your comments suggest that you only read the title...? – Nathan Ridley Feb 25 '16 at 04:12
  • Have you installed the wincred helper file? Have you tried doing a git config --global ghfw.disableverification true ? – Harald F. Feb 25 '16 at 07:43
  • @CmdrTchort just tried it... no cigar though. I think credential manager is only for username/password combos, not for ssh authentication. – Nathan Ridley Feb 25 '16 at 08:13
  • simple debugging is with `ssh -vvvT git@github.com verify`. What is the full output of that command? Does it ask for passphrase? If not, then there is problem with your git, unable to handle the agent. – Jakuje Feb 25 '16 at 10:03
  • @Jakuje thanks, tried that and clearly it's getting confused somewhere along the line. I've updated the question with details. – Nathan Ridley Feb 25 '16 at 11:20
  • @NathanRidley: I apologize. – kjo Feb 25 '16 at 11:22
  • It looks like some old key. I did not see `DES-EDE3-CBC` for a long time. Could you try to generate new one, set it up and give it a try once more? You are using some really ancient openssh version based on the logs (4.6p1 is really old). – Jakuje Feb 25 '16 at 11:49
  • Thanks @Jakuje yeah it looks I was pathed to an old version of git's bin folder, with binaries from 2013. A reinstall and a new key has now solved the problem. If you want to write up an answer, you'll get the points :D – Nathan Ridley Feb 26 '16 at 00:38
  • I can accept some :) Filled – Jakuje Feb 26 '16 at 08:06

1 Answers1

1

Some guides point out to the really old version of openssh (yes, current version is 7.1p1):

OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007

And the key looks also really ancient (I hope nobody is using DES in production anymore):

DEK-Info: DES-EDE3-CBC,xxxxxxxxxxxxxxxx

Make sure you have something more recent in your PATH.

Jakuje
  • 24,773
  • 12
  • 69
  • 75