导航

git Permission denied (publickey)

Posted on 2022-07-28 14:36  蝈蝈俊  阅读(138)  评论(0编辑  收藏  举报

clone 仓库时,碰到下面错误:

 % git clone ssh://git@git.aaa.com/~guohongjun/arch-measure.git
Cloning into 'arch-measure'...
git@git.aaa.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

原因本地有其他的git账户,需要使用多个SSH Key才可以。

先查看本地的.ssh目录下有哪些公钥私钥对,然后将id_rsa.pub的文件配置在git系统既可以了。

参考:如何告诉git哪个私钥要使用?