2026-04-02 23:12:36 +08:00

1.0 KiB
Raw Blame History

title, createTime, tags, categories
title createTime tags categories
git身份认证成功但public key permission denied 2024/07/02 15:24:51
git
随记

参考Authenticated but can't fetch or push

git pull的时候,明明配置好了 ssh-key但仍然报错

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

首先使用ssh -vT git@github.com验证 ssh 和 public key 是不是正常的,如果返回内容中有:

Hi YourUserName! You've successfully authenticated, but GitHub does not provide shell access.

这样的内容,那说明 ssh 和 public key 配置没有问题。

可能导致这样问题的原因可能是 git 使用的内嵌 ssh而这个内嵌的 ssh 找不到我们配置的 rsa 密钥。

解决办法就是先卸载 git然后重新安装时注意选择Use External OpenSSH!

external openssh