从bitbucket克隆git repo时权限被拒绝(publickey)

Die*_* Vo 4 git bitbucket ssh-keys

我刚刚在bitbucket上创建了git repo.然后我按照以下方式创建ssh密钥:

   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
Run Code Online (Sandbox Code Playgroud)

之后我选择了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.
Run Code Online (Sandbox Code Playgroud)

我不知道我错在哪里,请帮我解决.

Von*_*onC 8

您的ssh代理可能无法正常工作:

eval `ssh-agent -s` 
ssh-add
Run Code Online (Sandbox Code Playgroud)

但是,如果您生成了使用密码短语保护的ssh密钥,则只需要代理.
如果没有,您的ssh密钥将开箱即用.

在Linux上,检查可能会干扰的gnome-keyring.

如果问题仍然存在,请使用调试 ssh -Tv git@bitbucket.org