1

Why did I get the following error (on the same machine where the github connection had been properly set up before)? Meaning, it worked the previous day (e.g. I could push, pull, etc. with no problem) but didn't the next day.

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

When I did ssh-add:

$ ssh-add -l
The agent has no identities.

Is it possible that a key, which was previously loaded into SSH, is automatically unloaded?

The following fixed the issue (for reference):

ssh-add ~/.ssh/github_rsa
Enter passphrase for /Users/admin/.ssh/github_rsa: 
Identity added: /Users/admin/.ssh/github_rsa (/Users/admin/.ssh/github_rsa)
moey
  • 10,587
  • 25
  • 68
  • 112
  • Are you using GitHub for Windows? – VonC Nov 14 '12 at 18:40
  • I am using GitHub for Mac, War Room (87). – moey Nov 14 '12 at 21:26
  • Then maybe the credential helper (http://stackoverflow.com/questions/13385690/how-to-use-git-with-gnome-keyring-integration/13386417#13386417) had memorized your password only for your previous session, and you have to enter it again at the next session. – VonC Nov 14 '12 at 21:27

2 Answers2

0

The latest Github for (Mac|Windows) include a credential helper (as explained in "How to use git with gnome-keyring integration").

That means, if you need to enter a password (because your private ssh key is passphrase protected), that will be stored by git for the duration of the session.
But at the next session, you will need to enter the passphrase again (once).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

On the mac, identities that you add don't usually go away unless you explicitly remove them (ssh-add -d), the machine is rebooted, or you log out and then log back in again.

teu
  • 809
  • 11
  • 13