Git Clone:权限被拒绝(公钥).严重的:无法从远程存储库读取 [英] Git Clone : Permission denied (publickey). fatal: Could not read from remote repository

查看:135
本文介绍了Git Clone:权限被拒绝(公钥).严重的:无法从远程存储库读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用bitbucket,并且尝试使用以下命令克隆存储库: sudo git clone git@bitbucket.org:KassaK/mbf.git

I'm using bitbucket and I'm trying to clone a repo with : sudo git clone git@bitbucket.org:KassaK/mbf.git

我收到此错误:

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

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

我到处都在寻找解决方案,但是没有什么好处.

I search everywhere for a solution but with nothing good.

我遵循了 https://confluence中的说明.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html (转到Step),但我总是遇到此错误.

I folowed instructions from https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html (to Step), but I always have this error.

我试图删除并重新安装git,但还是一样.

I tried to remove and reinstall git but it's the same.

对我有什么想法吗?谢谢 !

Any ideas for me ? Thanks !

推荐答案

对于公钥身份验证系统,它与主机名,用户名,密钥文件名等有关,如果使用sudo运行,则用户名将为 root ,这与您运行ssh-keygen创建密钥对的方式不同.因此身份验证失败.

For public key authentication system, It concern with host name, user name, key filename, etc., If you run with sudo, the user name will be root, It is different with what you run ssh-keygen to create key pair. So authentication failed.

这篇关于Git Clone:权限被拒绝(公钥).严重的:无法从远程存储库读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆