I use an Ubuntu 14.10 distribution, and two private keys, one encrypted (~/.ssh/E.key), and one not encrypted (~/.ssh/NE.key), which I use for accessing two github repositories, respectively, repoE and repoNE.I use the common trick of aliasing gitbhub.com to two different domains, which are mapped to the respective ssh keys.Content (only relevant) of ~/.ssh/config:Host github.com-E  Hostname github.com  IdentityFile ~/.ssh/E.keyHost github.com-NE  Hostname github.com  IdentityFile ~/.ssh/NE.keyContent (only relevant) of local repository configurations:# /path/to/repoE/.git/config:[remote origin]  url = git@github.com-E:organizationE/repoE.git# /path/to/repoNE/.git/config:[remote origin]  url = git@github.com-NE:organizationNE/repoNE.gitI use ssh-add, so that I don't need to type the passphrase for any access to repoE.The problem is that apparently, only the first key I add is used (I can see the offer from the ssh client log).This is for example a sample run:$ ssh-add ~/.ssh/E.key# I can now access repoE, but not repoNE$ ssh-add ~/.ssh/NE.key# Still the same (I can access repoE, but not repoNE)$ ssh-add -D$ ssh-add ~/.ssh/NE.key# I can now access repoNE, but not repoE$ ssh-add ~/.ssh/E.key# Still the same (I can access repoNE, but not repoE)
Can ssh (agent) work with two separate identities?
ssh;git;ssh agent;github