git – error cloning bitbucket repository by ssh

Question:

I followed the steps on this site to be able to access Bitbucket via SSH on Ubuntu. But when I finished and tried to clone a repository the terminal printed this error:

Warning: Permanently added the RSA host key for IP address '104.192.143.2' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository.

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

So I would like to know why the error? And what to do to fix?

Answer:

This is a generic error that says the key that was used to connect was not recognized by the external server. It usually means that you made a mistake when configuring your public key in Bitbucket.

Follow the last part of the step-by-step again and it should solve.

Scroll to Top