I have been using my local Git and GitHub connection via an SSH key that suddenly (without obvious cause) is not allowing me to manage my remote repo's by push or pull. I've tried deleting the SSH key and regenerating one but the issue persists.
The exact error I get in the terminal is:
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The only change that happened since I was last able to use my account Git/GitHub connection was a Mac software update I ran last night. Before that the connection worked without issue. I am using a Mac on Sequoia 15.3.2.
The same question has also been posted on the GitHub community discussions page: .
Any suggestions would be greatly appreciated.
I have been using my local Git and GitHub connection via an SSH key that suddenly (without obvious cause) is not allowing me to manage my remote repo's by push or pull. I've tried deleting the SSH key and regenerating one but the issue persists.
The exact error I get in the terminal is:
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The only change that happened since I was last able to use my account Git/GitHub connection was a Mac software update I ran last night. Before that the connection worked without issue. I am using a Mac on Sequoia 15.3.2.
The same question has also been posted on the GitHub community discussions page: https://github/s/community/discussions/154186.
Any suggestions would be greatly appreciated.
Share Improve this question asked Mar 17 at 18:59 albeit2albeit2 1138 bronze badges 3 |1 Answer
Reset to default 0Thank you for all your help. I tried accessing the same GitHub account via the same credentials through a different computer, and all worked as expected. What I figured out in this process was I needed to:
Update my git (which was outdated enough to not allow signing).
Update the
~/.ssh/known_host
. It appears that after my computer update this might have changed, and this was ultimately the problem.
My current setup manages two git credentials using a global setting and an [includeIf ...] condition in the .gitconfig file. Each one has its own SSH Authorization and Signing keys. After scraping and re-creating the content of these files I tested them with the correct known_host settings, and this worked for all configurations.
ssh [email protected]
work? – Stephen Newell Commented Mar 17 at 19:41ssh -Tv [email protected]
? – phd Commented Mar 18 at 15:26