Search code examples
githttpsbitbucket

BitBucket HTTPS Clone - Authentication Failed


My GIT environment is set up correctly, but I get an error when cloning via HTTPS. I do have the correct access rights on BitBucket, and when I log in, I can see all the projects, including the one I want to clone.

I visited the website, and HTTPS is no longer supported.

How can I clone the project?


Update: I need to set up an App Password.

Terminal:

me@me:~$ git --version
git version 2.25.1
me@me:~$ git config --list
user.name=me
[email protected]

me@me:~$ git clone https://[email protected]/foo/bar.git
Cloning into 'bar'...
Password for 'https://[email protected]': 
remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings:
remote: https://bitbucket.org/account/settings/app-passwords/
fatal: Authentication failed for 'https://bitbucket.org/foo/bar.git/'

me@me:~$ git clone [email protected]:foo/bar.git
Cloning into 'bar'...
The authenticity of host 'bitbucket.org (104.192.141.1)' can't be established.
RSA key fingerprint is SHA256:BLAH.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'bitbucket.org,104.192.141.1' (RSA) to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

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

Solution

You need to set up an App Password.

On Bitbucket, follow these 6 steps.

Then, in Terminal:

git clone https://USERNAME:[email protected]/username/reposlug.git

Source


Solution

  • To solve this please see this

    Overview of what the link describes:

    As you pointed out from the error message, from March 1, 2022, Bitbucket Cloud users will no longer be able to use their account passwords when using Basic authentication for Git over HTTPS.

    This can be resolved by switching to App Password from Account Password. First, log in to BitBucket and follow the instructions specified to create an App Password in BitBucket once it is done set the origin URL to use the App Password.