0

I have 2 different GitHub accounts and I am running Ubuntu.

I was following answers on Stack Overflow like this one and was getting all kinds of grief with the wrong key being used. Trying to narrow down the problem ...

  • I deleted all the keys in ~/.ssh - still getting the wrong user when pushing to Github.
  • I deleted the known_hosts and config files in ~/.ssh. - the same as above.
  • I deleted all the keys in both GitHub accounts - I can still git push!
  • I rebooted my system - but I still can push to Github!?!

Where are these keys now stored? Depending what I place in my local .git/config I can get the GitHub account I want, but am mighty curious about where and how these keys get checked! I would have figured that doing a git push now would fail.

Edit: I can commit to the Github I want - I used "none" for global git config email and set the local git config to the email I want to commit under.

I spun up another partition (different Ubuntu version) on my same machine - did a git clone, and can commit! Didn't ask for my ssh key - just my github user/pass. There is no ssh key on my github account at the moment. Somehow it still remembers, I'll just accept that.

Community
  • 1
  • 1
rtfminc
  • 6,243
  • 7
  • 36
  • 45
  • Try running `ssh-add -l` to list any keys currently known by your ssh agent. It may be caching something, or pulling a key from some place you are not aware of. Also, since you are using Ubuntu, check out this question too http://stackoverflow.com/questions/25464930/how-to-remove-a-ssh-key – Kevin Burdett Apr 25 '16 at 14:41
  • I did that, listed them. Then I also removed them from ssh agent, as I had the same thought. Still not what being committed as I want. That is when I deleted and I was surprised that it worked! I spun up another partition (Ubuntu14) that I boot from (same machine) and it still works!?! – rtfminc Apr 26 '16 at 22:21
  • Is your remote URL (`git remote -v`) showing a git or ssh URL? Or is it https? Your ssh configuration won't apply if you've used the wrong URL when cloning. – Paul Hicks Apr 26 '16 at 22:39

0 Answers0