Interview Prep/Git & GitHub/Authentication and Remote Access

`[email protected]: Permission denied (publickey).` followed by `fatal: Could not read from remote repository.`

BeginnerTroubleshootingAuthentication and Remote Access
Answer

Likely causes → No SSH key is loaded, the public key was never added to GitHub, or the wrong key is offered.

Diagnose →

ssh -vT [email protected]        # look for "Offering public key" and the final result
ssh-add -l                    # keys loaded in the agent

Fix → Generate a key if needed (ssh-keygen -t ed25519 -C "[email protected]"), start the agent, ssh-add ~/.ssh/id_ed25519, and paste ~/.ssh/id_ed25519.pub into GitHub → Settings → SSH keys. Test with ssh -T [email protected]; success prints "Hi <user>! You've successfully authenticated".

Prevent → Keep a documented onboarding step for keys and an ~/.ssh/config entry with IdentityFile.

All Git & GitHub questions Roadmap: Git & GitHub

More on Authentication and Remote Access