If the message is here:
Maybe you didn’t put your key id_rsa.pub in the "Access Keys" bitbucket.org at the right place. In bitbucket sometimes confuses a little, you have projects and repositories and sometimes we can confuse with this.
Verify that your key is actually in the repository you want to make git clone.
When logging into bitbucket you will have how to choose between project or repository and their urls to access the "Settings" where the keys are located would look something like the urls below:
Username
bitbucket.org/username/repositorio/admin/access-Keys/
Or Team
bitbucket.org/seuteam/repositorio/admin/access-Keys/
You go to projects or repositories to apply your Settings.
But before it is clear a check if correctly generated the access keys.
In linux would look like this:
1) creating access key
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/emmap1/.ssh/id_rsa):
Press the Enter or Return key to accept the default location.
2) Different paths in the creation of your id_rsa
To create a key with a different default name or path, specify the full path to the key. For example, to create a key called my-new-ssh-key, enter a path like the one shown at the prompt:
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/emmap1/.ssh/id_rsa): /Users/emmap1/.ssh/my-new-ssh-key
3) Type and re-enter a passphrase when prompted.
The command creates its default identity with its public and private keys. All interaction will look similar to the following:
ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/emmap1/.ssh/id_rsa):
Created directory '/Users/emmap1/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/emmap1/.ssh/id_rsa.
Your public key has been saved in /Users/emmap1/.ssh/id_rsa.pub.
The key fingerprint is:
4c:80:61:2c:00:3f:9d:dc:08:41:2e:c0:cf:b9:17:69 [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
|*o+ooo. |
|.+.=o+ . |
|. *.* o . |
| . = E o |
| o . S |
| . . |
| . |
| |
| |
+-----------------+
4) List the contents of ~ / . ssh to view the key files
$ ls ~/.ssh
id_rsa id_rsa.pub
Now just use the command below to copy and put your public key in bitbucket
$ cat ~/.ssh/id_rsa.pub
Now to test if everything went well do the following on your linux console.
$ ssh -T [email protected]
conq: logged in as emmap1.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
If your message is equal above it is because something went wrong possibly your key in bitbucket is not configured correctly.
Command message tells you which of your Bitbucket accounts can log in with this key.
If the above command sends a message as is
authenticated via a deploy key.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
This deploy key has read access to the following repositories:
username/seurepositorio: name1-chave -- [email protected]
team-2017/repositorio: name2-chave -- [email protected]
The message tells you exactly which repository has been cloned for your machine and its access.
If using Windows or Mac I suggest accessing this link https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html
It worked, thank you very much Jefferson... Now tell me one thing, for every repository I create, do I have to redo the entire procedure, including creating another ssh key on my machine? In this case, it is good practice that the ssh key name has the same name as my respective repository?
– Matheus Nascimento
In bitbucket you can put the keys in the project, team and team user.
– Jefferson Otoni Lima
In bitbucket you can put the keys in the project, team and team user. Do some tests for your reality to see which one suits you best. When you add the key directly to the user it will have access to all repositories. When creating a repository you have the option to insert the key for each user, or you can try putting in the team/projects that theoretically would put a single time for each project but have to test and see if the option is not paid. You do not need to create multiple keys on your machine review your access policy in bitbucket as described above.
– Jefferson Otoni Lima