KNOWLEDGEBASE · TUTORIALS
How to clone a private BitBucket.org repository to cPanel?
Last updated 2020-10-26
Currently, the cPanel interface does not work with private-repositories on bitbucket.org. Hence we recommend this workaround.
Create a password-less ssh-key from cPanel > Terminal by entering the following command
Now display the generated public-key using the command
Then from cPanel > Terminal create a new file with the command
Now paste into it the following contents and save it. You can use your favorite editor to achieve this
From cPanel > Terminal set permissions for the new files
We are ready to test the connection to bitbucket.org using key authentication by running the command at cPanel > Terminal
If you get an error, please create a ticket for us to look into the issue, else enter the following command to clone the repository from cPanel > Terminal
Create a password-less ssh-key from cPanel > Terminal by entering the following command
cd ~/.ssh/ ssh-keygen -t rsa -b 4096 -C "username@example"In the above command, replace 'username' with cPanel's username, 'example' with domain-name. When prompted for a password press 'enter' twice without entering a password.
Now display the generated public-key using the command
cat ~/.ssh/id_rsa.pubCopy and paste the displayed public-key into the bitbucket.org > Personal Settings > Security > SSH Keys
Then from cPanel > Terminal create a new file with the command
touch ~.ssh/config
Now paste into it the following contents and save it. You can use your favorite editor to achieve this
host bitbucket.org HostName bitbucket.org IdentityFile ~/.ssh/id_rsa User git
From cPanel > Terminal set permissions for the new files
chmod 600 ~/.ssh/config && chmod 400 ~/.ssh/id_rsa
We are ready to test the connection to bitbucket.org using key authentication by running the command at cPanel > Terminal
ssh -i ~/.ssh/id_rsa -T git@bitbucket.org
If you get an error, please create a ticket for us to look into the issue, else enter the following command to clone the repository from cPanel > Terminal
git clone ssh://user@bitbucket.org/user/privaterepositoryname.gitReplace 'user' with bitbucket.org account's username and 'privaterepositoryname' with the repository name at bitbucket.org that you want to clone to cPanel
Tell us what has to stay up.
A short conversation with an engineer. No quote-bot, no callback queue. We'll tell you honestly if we're not the right fit.