Problems with Bitbucket Team Remote Repository

2

I created a Team in bitbuckt, and I created a Project for this Team and in this Project I created a Repository . I added to Team, a ssh key I created on my machine (Ubuntu), however when I run git clone copying the ssh url I get the following error:

Permission denied (publickey).
fatal: Could not read from remote repository.

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

I would like to know how I can do to create a specific public key for this Team , as I would not like to have it passed to my team with the global ssh key (with access to all repositories of bitbucket).

    
asked by anonymous 19.10.2017 / 13:02

1 answer

2

If the for message is here:

Youmaynothaveputyourid_rsa.pubkeyinAccesskeysforbitbucket.orginthecorrectlocation.Inbitbucketsometimesconfusesalittle,youhaveprojectsandrepositoriesandsometimeswecanconfusewiththis.

Checkifyourkeyisactuallyintherepositoryyouwanttogitclone.

Whenyoulogintobitbucketyouwillhavetochoosebetweenprojectorrepositoryandyoururlstoaccess"Settings" where the keys will look something like the urls below:

Username

bitbucket.org/username/repository/admin/access-keys /

Or Team bitbucket.org/seuteam/repository/admin/access-keys/

You go into projects or repositories to apply your Settings .

But it is clear from the one checked if you have correctly generated the access keys.

In linux it 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 Enter or Return to accept the default location.

2) Different paths in creating your id_rsa

To create a key with a name or path other than the default, specify the full path to the key. For example, to create a key named my-new-ssh-key, enter a path as shown in 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-insert a passphrase when prompted.

The command creates your default identity with your public and private keys. All of the 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 contents of ~ / .ssh to see key files

$ ls ~/.ssh
id_rsa id_rsa.pub 

Now just use the command below to copy and put your public key on bitbucket

$ cat ~/.ssh/id_rsa.pub

Nowtotestifeverythingwentwell,dothefollowingonyourlinuxconsole.

[email protected]:loggedinasemmap1.YoucanusegitorhgtoconnecttoBitbucket.Shellaccessisdisabled.

Ifyourmessageisthesameasaboveit'sbecauseyougavesomethingwrongpossiblyyourbitbucketkeyisnotconfiguredcorrectly.

ThecommandmessagetellsyouwhichofyourBitbucketaccountscanloginwiththiskey.

Iftheabovecommandsendsamessageasitis

authenticatedviaadeploykey.YoucanusegitorhgtoconnecttoBitbucket.Shellaccessisdisabled.Thisdeploykeyhasreadaccesstothefollowingrepositories:username/seurepositorio:[email protected]/repositorio:[email protected]

Themessagetellsyouexactlywhichrepositoryhasbeenclonedforyourmachineanditsaccess.

IfyouareusingWindowsorMacIsuggestaccessingthislink link

    
19.10.2017 / 16:01