BitBucket: Host Key Authentication Error

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

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

and I got a 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 was already dealing with ssh issues. I generated the ssh key with the ' ssh-keygen ' command, and I copied the contents of ~/.ssh/id_rsa.pub to Bitbucket Settings -> SSH keys (from 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:

enter image description here

Can you advise me what to do?

+6
source share
1 answer

The message says:

Failed to verify host key.

nothing about authentication, so you are working on the wrong field. This means that the host key bitbucket.org is not in your ~/.ssh/known_hosts , and your client has no way to verify it. He was answered many times , how to get around it, but how to do it right?

The bitbucket manuals have a section describing what their public keys and fingerprints look like. So:

  • Run ssh bitbucket.org
  • He will tell you 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)? 
  • You verify that the fingerprint in the tooltip is the same as on the bitbucket website:

     SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A bitbucket.org (RSA) 
  • You type yes and press enter to check if the connection is working.

Or simply copy the public key from the bitbucket website directly into the ~/.ssh/known_hosts

 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 none of the above helps, run ssh -vvv bitbucket.org and post the result in the edited question.

+6
source

Source: https://habr.com/ru/post/1012286/


All Articles