There was a problem loading the comments.

How to clone a private repository to cPanel?

Support Portal  »  Knowledgebase  »  Viewing Article

Currently, the cPanel interface does not work with private-repositories on Hence we recommend this workaround.

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/
Copy and paste the displayed public-key into the > 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
 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 using key authentication by running the command at cPanel > Terminal
ssh -i ~/.ssh/id_rsa -T

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://
Replace 'user' with account's username and 'privaterepositoryname' with the repository name at that you want to clone to cPanel

Share via
Thank you for your feedback on this article.

Related Articles


Add Comment

Replying to  

Self-Hosted Help Desk Software by SupportPal