`[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.
More on Authentication and Remote Access
`remote: Support for password authentication was removed on August 13, 2021.`Beginner`fatal: Authentication failed for 'https://github.com/org/repo.git/'` with a token that worked last month.Beginner`WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!` when connecting to GitHub over SSH.Intermediate`remote: Repository not found.` for a repo you can open in the browser.Beginner`ssh -T [email protected]` says "Hi someone-else!" but you need your work account.Intermediate`ssh: connect to host github.com port 22: Connection timed out` on a corporate or hotel network.Intermediate