caarlos0 caarlos0 - 1 year ago 185
Git Question

git suddenly started to ask for SSH key password every time

So, I use git and github with MFA, so, to avoid annoying password asking, for more than a year I am using the
URL style.

A couple of days ago, I ran a
brew update
, and now, every time try to sync with github servers, git asks me the key password.

What I did so far:

  • Checked my configs, seems ok to me, but here it is (the relevant part):

    name = Carlos Alexandro Becker
    email =
    helper = osxkeychain

  • Tried to update git and osxkeychain, current versions are:

    git 2.4.1
    OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011

  • Cleaned osxkeychain for

  • checked that ssh-agent is running, re-added my identity

The one weird thing that I saw is this:

$ ssh-add ~/.ssh/
Could not open a connection to your authentication agent.
$ ssh-agent sh -c 'ssh-add ~/.ssh/'
Enter passphrase for /Users/carlos/.ssh/

So, my guess is that somehow ssh-agent is not working properly, but I don't have any idea why nor how to fix it.

Answer Source

Seems like something went wrong with my ssh-agent.

I tried to stop it (with kill -9) and start it again (with ssh-agent), but it wouldn't fix the problem.

After I ran eval 'ssh-agent -s' it all started to work as expected again.

Still I have no idea why this happened..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download