BitBucket:主机密钥身份验证失败 [英] BitBucket: Host key authentication failed

查看:758
本文介绍了BitBucket:主机密钥身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将远程存储库克隆到本地计算机。我使用了以下命令:

  git clone git@bitbucket.org:< username> /< repo_name> .git 

我收到了消息:

 主机'bitbucket.org(104.192.143.3)'的真实性不能成立
。 RSA密钥指纹是
SHA256:****。你确定你
想要继续连接吗(是/否)?主机密钥验证失败。
致命:无法从远程存储库读取。

请确保您拥有正确的访问权限并存在
存储库。

我只想提及我已经照顾过ssh问题。我通过命令' ssh-keygen '生成了一个ssh密钥,并且我复制了〜/ .ssh / id_rsa.pub Bitbucket设置 - > SSH密钥(根据此链接:



你能告诉我该怎么做吗?



解决方案

主机密钥验证失败。


没有关于身份验证,所以您正在处理错误的字段。这意味着bitbucket.org 的主机密钥不在您的〜/ .ssh / known_hosts 中,您的客户端没有任何方式验证它。 已经回答了很多次如何解决它,但是如何正确地做到这一点?



section 。因此:
$ b


  1. 运行 ssh bitbucket.org

  2. 它会提示你一个指纹:

     主机的真实性'bitbucket.org(104.192 .143.3)'不能建立。 
    RSA密钥指纹是SHA256:*****。
    您确定要继续连接(是/否)吗?


  3. 验证提示中的指纹与 bitbucket网站

     SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A bitbucket.org(RSA)


  4. 您写,然后按回车确认连接是否正常。


或者只需从 bitbucket网站直接在〜/ .ssh / known_hosts 文件中

  echo bitbucket.org,104.192.143.1 SSH-RSA AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl / VqLat / MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy + YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6 rYI74nMzgz3B9IikW4WVK + dc8KZJZWYjAuORU3jc1c / NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO + mN2t / FZTMZLiFqPWc / ALSqnMnnhwrNi2rbfg / rd / IpL8Le3pSBne8 + seeFVBoGqzHM9yXw ==>> 〜/ .ssh / known_hosts 

如果上述内容没有帮助,请运行 ssh -vvv bitbucket.org 并将输出发布到编辑后的问题。


I want to clone a remote repository to my local machine. I used the command:

git clone git@bitbucket.org:<username>/<repo_name>.git

and I got the message:

The authenticity of host 'bitbucket.org (104.192.143.3)' can't be
established. RSA key fingerprint is
SHA256:****. Are you sure you
want to continue connecting (yes/no)?  Host key verification failed.
fatal: Could not read from remote repository.

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

I just want to mention that I already took care of the ssh issues. I generated an ssh key by the command 'ssh-keygen' and I copied the contents of ~/.ssh/id_rsa.pub to Bitbucket Settings -> SSH keys (according to this link: https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html)

I also looked at my "user and group access" and I saw this:

Can you advise me what to do?

解决方案

The message says

Host key verification failed.

nothing about authentication, so you are working on the wrong field. It means that the host key of the bitbucket.org is not in your ~/.ssh/known_hosts and your client does not have any way how to verify it. It was answered many times how to workaround it, but how to do it properly?

There is section in the bitbucket manuals, describing how their public keys and fingerprint looks like. So:

  1. Run ssh bitbucket.org
  2. It will prompt you with one of the fingerprints:

    The authenticity of host 'bitbucket.org (104.192.143.3)' can't be established.
    RSA key fingerprint is SHA256:*****.
    Are you sure you want to continue connecting (yes/no)?
    

  3. You verify the fingerprint in the prompt is the same as on the bitbucket website:

    SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A bitbucket.org (RSA)
    

  4. You write yes and press enter to verify the connection works.

Or just copy the public key from the bitbucket website directly in the ~/.ssh/known_hosts file

echo "bitbucket.org,104.192.143.1 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==" >> ~/.ssh/known_hosts

if nothing from the above helps, please run ssh -vvv bitbucket.org and post the output to the edited question.

这篇关于BitBucket:主机密钥身份验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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