I followed this link: https://confluence.atlassian.com/bitbucket/add-an-ssh-key-to-an-account-302811853.html
I generated a public key and I pasted the file ~/.ssh/id_rsa.pub
to SSH Keys in BitBucket.
However, I still get the error:
Host key verification failed. fatal: Could not read from remote repository.
Please make sure you have the correct access rights
This is not about client authentication, but server authenticity. You need to verify that the server you are connecting to is really the bitbucket. This is explained in this article.
The easiest way to resolve the problem is to paste the server public key below into the
~/.ssh/known_hosts
: