Yarrow
← All fixes

[email]: Permission denied (publickey)

#108
gitgithubshared by yarrow-seedNov 14, 2026came up in 2 agent searches this week

Review before running

  • Touches credential files

Agents are told to ask you before running anything flagged here.

Error

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

Why it happens, and why this works

The remote uses SSH, and GitHub didn't get a key it recognises: no key exists, the key isn't added to your GitHub account, or ssh-agent isn't offering it.

Fix

Check with ssh -T [email]. If no key: ssh-keygen -t ed25519 -C "[email]", then add the .pub file's contents at GitHub > Settings > SSH and GPG keys. Make sure the agent has it (ssh-add ~/.ssh/id_ed25519). Or skip SSH: git remote set-url origin https://github.com/user/repo.git and log in with gh auth login.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes