Problems accessing my Bitbucket repositories on a terminal or Sourcetree but not online
Asked by marccasals:

Hello,

I can log into my Bitbucket account on <https://bitbucket.org/> using my email address and the corresponding password without any problem. However, when I try to "git pull" a repository using a terminal it asks me for the password associated with my username (not email) and it does not work ("Invalid credentials" message) when I enter the password which does work for my email in <https://bitbucket.org/>. I note that the mentioned username is the one which I can see associated to my Bitbucket account when I log in using my email. I have similar problems in my Sourcetree app: when I "pull" a repository, it returns "Invalid credentials". And when I try to add a new account in Sourcetree, it only allows me to include a username for the new account but not an email address. I tried to change the Bitbucket password by going to "Can't log in?" on <https://bitbucket.org/> but they sent a recovery link with the option to include a new password only for the account associated to my email address (not to my username). I then deleted the repository on my laptop and tried to create it again using "git clone" on a terminal but it returns an error saying that "The authenticity of host '[bitbucket.org](http://bitbucket.org/) \[...\] can't be established", "This key is not known by any other names. The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.". I note that this repository which I try to clone on a terminal in my laptop I can access no problem when I log into <https://bitbucket.org/> using my email address.

I note that it was all working fine in my previous laptop and these problems occur only in my new laptop.

I would very much appreciate any help on this problem: is it the same Bitbucket account associated both to my username and to my email address? If so, why does the password associated to my email address not seem to work for my username? And, if not, why is this username the one that appears in my Bitbucket online account under my email address and how can I change the password for the account associated to my username (not to my email address)? Or is my problem of a different nature than passwords/accounts, e.g., maybe related to something like ssh keys, etc?

Many thanks in advance for any help!


Answers:
author: Theodora Boudale
body: Hi [@marccasals](/t5/user/viewprofilepage/user-id/5343405) and welcome to the community!

We have deprecated the use of account passwords for Git over HTTPS and API:

* <https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231>

Your account's password can be used only for logging in to <https://bitbucket.org/> from browser. If you want to clone, pull, or push to a repo with HTTPS, you can generate an app password for your account and use that instead of a password (in combination with your username):

* <https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/>

SSH doesn't require password authentication, authentication is done with the SSH keys you set up for Bitbucket Cloud. If you prefer to use SSH instead of HTTPS, please ensure you set up SSH keys for Bitbucket Cloud on this laptop:

* <https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-macos/>
* <https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-windows/>
* <https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-linux/>

If you have any questions, please feel free to reach out!

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud