Everything works for the first user (Git user, not Unix user), let's call him aaa, against the first repository. aaa is set as git user.name and user.email globally using the command
git config --global user.name "aaa"
git config --global user.email [email protected]
aaa executes the command
git push origin master
successfully.
Then I have a second user, let's call him bbb (again Git user, not Unix usr) on the same machine, but different local working directory, trying to push to a different Git repository. First, I override the user.name and user.email properties. So right after git init, I execute:
git config user.name "bbb"
git config user.email [email protected]
Then to confirm:
git config --get user.name
does return bbb. When I try to have bbb push to his own repository, git prompts for the SSH passphrase, and it seems to accept the passphrase, but errors out by saying permission denied to aaa.
I suspect that this has something to do with SSH keys. Is that a right assumption?