caarlos0 caarlos0 - 24 days ago 9
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

git@github.com:user/repo.git
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):

    [user]
    name = Carlos Alexandro Becker
    email = caarlos0@gmail.com
    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 github.com

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



The one weird thing that I saw is this:

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


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

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..