# gitee克隆项目报错 Permission denied (publickey) 的解决办法

**URL:** <https://www.shiqidu.com/t/topic/760>\
**Category:** 资源分享\
**Tags:** 软件\
**Created:** [2021 年10 月 20 日 02:45 UTC](https://www.shiqidu.com/t/topic/760 "2021-10-20T02:45:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![Leon](https://www.shiqidu.com/user_avatar/www.shiqidu.com/leon/32/5_2.png) [@Leon](https://www.shiqidu.com/u/Leon)\
发布日期： [2021 年10 月 20 日 02:45 UTC](https://www.shiqidu.com/t/topic/760/1 "2021-10-20T02:45:22Z")

</div>

如果你安装了最新的git for windows新版 (\>=2.33.1)，在克隆或拉去gitee项目时报如下的错误

```bash
Update failed
git@gitee.com: Permission denied (publickey).
Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

```

网上的方法大部分是让你在本地生产一下sshkey

```bash
ssh-keygen -t rsa -C "your email"

```

然后去gitee配置一下ssh公钥。

* * *

如果你使用上面的方法时候还是报错没有权限。

请看gitee[官方文档](https://gitee.com/help/articles/4352#article-header0)，原因就是OpenSSH 8.8中移除了对RSA-SHA1的支持，而git for windows新版(\>=2.33.1)使用了openssh 8.8，且gitee使用的ssh工具库不支持RSA-SHA2算法，所以导致了这个问题。解决办法也很简单，官方给出了三个办法，具体可以看官方文档，我使用的是第二个办法。换个加密算法生成ssh key。

```bash
ssh-keygen -t ed25519 -C "your@example.email"

```

生成之后复制公钥配置到gitee账号即可。
