# Private Bitbucket Repository¶

In this guide, we’ll link a private Bitbucket repository to a Valohai project using an access key.

## 1. Requirements¶

For this tutorial you will need:

• a private Bitbucket repository
• a Valohai project which to link the repository
• a tool that generates SSH keys, this guide uses ssh-keygen

## 2. Generate an SSH key pair¶

\$ ssh-keygen -t rsa -b 4096 -N '' -f my-project-access-key


The ssh-keygen above generates two files:

• my-project-access-key.pub is the public key you add to Bitbucket.
• my-project-access-key is the private key you add to Valohai.

You should not include these keys in the version control. Anybody that gains access to the my-project-access-key file contents will have read access to your repository so use appropriate caution.

## 3. Add the public key to Bitbucket¶

Find the my-project-access-key.pub file we generated in the last section, and it should contain one line that starts with ssh-rsa AAAA.... This line is the public key that we’ll be adding to Bitbucket.

## 4. Add the private key to Valohai¶

Find the my-project-access-key file (without the .pub extension) we generated before. It should contain multiple lines starting with -----BEGIN RSA PRIVATE KEY----- or something similar. The contents of this file are the private key we’ll be adding to Valohai.

## 5. Results¶

We linked a private Bitbucket repository to a Valohai project using access keys.