Interview Prep/Git & GitHub/Authentication and Remote Access

`ssh -T [email protected]` says "Hi someone-else!" but you need your work account.

IntermediateTroubleshootingAuthentication and Remote Access
Answer

Likely causes → SSH offers the first key in the agent, and GitHub maps that key to the personal account. A key can belong to only one account.

Diagnose → ssh -vT [email protected] 2>&1 | grep -i "offering" shows the order of keys offered.

Fix → Create a host alias with IdentitiesOnly yes and the work key:

Host github-work
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519_work
  IdentitiesOnly yes

Then use git remote set-url origin git@github-work:ORG/REPO.git.

Prevent → Keep one key per account and always set IdentitiesOnly yes.

All Git & GitHub questions Roadmap: Git & GitHub

More on Authentication and Remote Access