want to map unix (Linux and AIX) servers directly with BitBucket repository

We have a requirement to map unix servers directly with BitBucket so as to upload files from servers to the BitBucket repo. Appreciate if someone can suggest what additional steps are required apart from the config steps we have listed below -


1 - On one of Linux server I have run ssh-keygen -t rsa under my home directory. this created the private and public ssh keys under $HOME\.ssh2

2 - went to the BitBucket Repo (e.g. Stars 7956) and created a fresh repository. I have admin privilege here.

3 - added ssh public key from server to the access key option present under repo (have also tried adding key from maage account)

4 - picked ssh string from the new BitBucket repo clone tab

5 - At unix server I have run "Git init" and then run "Git Clone ssh:\\url..."

6 - The Git clone is filing with error message as highlighted below -

bash-4.1$ git clone

Cloning into 'prpc_5'...

fatal: Could not read from
remote repository.

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


Thanks and regards


1 answer

0 votes

Hi Krisha,

Hopefully you're not experiencing this anymore, however, if you are there is a knowledge base article titled Git clone fails due when cloning via SSH that may help:

  • Ensure an SSH key has been added to the user or the repository
  • Check the existing keys on the client by running

    ssh-add -l
  • Attempt to clone a change to the repository with the Git client debug on:

    # Example on Linux
    GIT_SSH_COMMAND="ssh -vvv" git clone ssh://git@<bitbucket URL>:<bitbucket port>/<project key>/<repository slug>.git

    The log will show which key has been used for the authentication and which ones have been tried. The line to check will look like the following:

    debug1: Offering RSA public key: /Users/<username>/.ssh/id_rsa


It sounds like you have verified the keys were added to the repository already so try the rest of the steps and let us know.



Hi Branden,

thank you for your reply. Yes, I was able to map the ssh keys properly. the catch was with private key which should be defined with a separate ssh.bash script and exported with GIT_SSH.




Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

655 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you