SSH keys

If you don't have SSH configured, then you've been using the secure hypertext transfer protocol (HTTPS) to communicate between your local system and Bitbucket Cloud. Set up SSH to reduce the risk of exposing your username and password.

This table compares HTTPS and SSH to give you a better idea of the difference between the two.

HTTPSSSH
  • Is suitable if you push to and pull from Bitbucket infrequently.
  • Requires you to enter a password each time you connect.
  • Is more effective if you push and pull from Bitbucket many times a day.
  • Removes the need to enter a password each time you connect.

The URL you use to access a repository depends on the connection protocol (HTTPS or SSH) and the distributed version control system (Git or Mercurial). You can find your repository-specific URLs from the repository Source page. The following table shows these URL formats:

GitHTTPShttps://<repo_owner>@bitbucket.org/<accountname>/<reponame>.git
SSH

git@bitbucket.org:<repo_owner>/<reponame>.git

or

ssh://git@bitbucket.org/<repo_owner>/<reponame>.git

MercurialHTTPShttps://<accountname>@bitbucket.org/<repo_owner>/<reponame>
SSHssh://hg@bitbucket.org/<repo_owner>/<reponame>/

Bitbucket supports four encryption algorithms for user keys: Ed25519, ECDSA, RSA, and DSACreate keys using the encryption method that is available to you.

You may want to record Bitbucket's public host key before connecting to it for the first time. Depending on the security protocols in your network, the system administrator may maintain a centrally located list of approved known hosts. The public key fingerprints for the Bitbucket server are:

SHA256 format
2048 SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A bitbucket.org (RSA)
1024 SHA256:RezPkAnH1sowiJM0NQXH90IohWdzHc3fAisEp7L3O3o bitbucket.org (DSA)
md5 format
97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40 (RSA)
35:ee:d7:b8:ef:d7:79:e2:c6:43:9e:ab:40:6f:50:74 (DSA)

To get the format suitable for storage in the known hosts, you can use the following ssh-keyscan command:

$ ssh-keyscan -t rsa bitbucket.org
# bitbucket.org SSH-2.0-OpenSSH_5.3
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==


Last modified on Jun 23, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.