我刚刚在 bitbucket 上创建了 git 仓库。然后我通过以下方式创建 ssh key :
1. ssh-keygen -t rsa -C 'dien.vo@asnet.com.vn'
2. ssh-keygen (press enter more)
3. cat ~/.ssh/id_rsa.pub --> it return for me a SSH key
4. Coppy that and added on bitbucket, then I save the new SSH key
之后我选择了 SSH 链接 git,比如 git@bitbucket.org:DienVo/abc.git
,但是在终端中它显示了
sign_and_send_pubkey: signing failed: agent refused operation
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我不知道我这里有什么问题,请帮我解决。
最佳答案
您的 ssh 代理可能无法正常工作:
eval `ssh-agent -s`
ssh-add
但是,如果您生成了一个受密码保护的 ssh key ,则只需要一个代理。
如果没有,您的 ssh key 将开箱即用。
在 Linux 上,检查 gnome-keyring which can interfere .
如果问题仍然存在,请使用 ssh -Tv git@bitbucket.org
进行调试
关于git - 从 bitbucket 克隆 git repo 时权限被拒绝(公钥),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44253270/